Skip to content

Instantly share code, notes, and snippets.

let graphAdj;
let visited;
let stack;
const initGraph = (maxVertice) => {
visited = new Array(maxVertice);
stack = []
@tpae
tpae / Trie.js
Created November 20, 2016 23:49
Trie.js - super simple JavaScript implementation
// Trie.js - super simple JS implementation
// https://en.wikipedia.org/wiki/Trie
// -----------------------------------------
// we start with the TrieNode
function TrieNode(key) {
// the "key" value will be the character in sequence
this.key = key;
@moduscreate
moduscreate / using_placeholder_images_with_react_native.js
Last active July 24, 2017 09:50
Using placeholder images with react native
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
Image,
Dimensions,
StatusBar,
ScrollView
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),