Skip to content

Instantly share code, notes, and snippets.

View vndeguzman's full-sized avatar

Vic de Guzman vndeguzman

View GitHub Profile
@vndeguzman
vndeguzman / index.html
Last active March 19, 2019 13:33
Generated by SassMeister.com.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="import" href="main.html">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Hello world!</h1>
@vndeguzman
vndeguzman / SassMeister-input-HTML.html
Created March 19, 2019 13:18
Generated by SassMeister.com.
<header>
<div class="burger-menu"></div>
<a id="logo">logo</a>
<form>
<input type="text" placeholder="search..." />
<button type="submit">search</button>
</form>
</header>
@vndeguzman
vndeguzman / cpu.js
Created September 18, 2018 03:29 — forked from bag-man/cpu.js
How to calculate the current CPU load with Node.js; without using any external modules or OS specific calls.
var os = require("os");
//Create function to get CPU information
function cpuAverage() {
//Initialise sum of idle and time of cores and fetch CPU info
var totalIdle = 0, totalTick = 0;
var cpus = os.cpus();
//Loop through CPU cores
@vndeguzman
vndeguzman / cpu.js
Created September 18, 2018 03:29 — forked from bag-man/cpu.js
How to calculate the current CPU load with Node.js; without using any external modules or OS specific calls.
var os = require("os");
//Create function to get CPU information
function cpuAverage() {
//Initialise sum of idle and time of cores and fetch CPU info
var totalIdle = 0, totalTick = 0;
var cpus = os.cpus();
//Loop through CPU cores
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vndeguzman
vndeguzman / problem.subset-containment.md
Last active August 29, 2017 13:39
Problem: Subset/Containment

Write an O(N) running function that returns true if:

  • Every element of string A are all elements of string B
  • Every element of string B are all elements of string A

truth condition venn diagram

Expected Output:

  • contains(‘abcd’, ‘abcd’); // true
  • contains(‘abcd’, ‘abcdd’); // true
  • contains(‘abcdd’, ‘abcd’); // true