Skip to content

Instantly share code, notes, and snippets.

View iwatakeshi's full-sized avatar
📚
Always learning

Takeshi iwatakeshi

📚
Always learning
View GitHub Profile
@iwatakeshi
iwatakeshi / dijkstra.cpp
Created October 13, 2017 15:55 — forked from johngian/dijkstra.cpp
Dijkstra in C++ using STL
#define MAX 999999999
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <vector>
#include <queue>
#include <utility>
using namespace std;
class compare
@iwatakeshi
iwatakeshi / gist:e7b24ea44206eab7f2bfa3188a47e874
Created October 12, 2017 17:10 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@iwatakeshi
iwatakeshi / gulpfile.js
Created April 8, 2016 04:52 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@iwatakeshi
iwatakeshi / node-and-npm-in-30-seconds.sh
Created March 24, 2016 17:32 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl -k -L https://npmjs.org/install.sh | sh
@iwatakeshi
iwatakeshi / .gitignore
Created November 16, 2015 19:48 — forked from mathiasbynens/.gitignore
Generating a regular expression to match valid JavaScript identifiers (like https://mathiasbynens.be/demo/javascript-identifier-regex) in Node.js
node_modules
@iwatakeshi
iwatakeshi / array-early-exit-options.js
Created October 9, 2015 04:20 — forked from wilmoore/array-early-exit-options.js
Array iteration early exit options -- best options are lodash.forEach or Array#some.
/**
* Use `Array#some` when it is convenient to exit on truthy return values
* Use `lodash.forEach` when it is convenient to exit on false (you can cast if necessary with `!!`)
*/
var _ = require('lodash');
var numbers = [1, 2, 3, 4, 5, 6];
console.log('Array#forEach (result not as expected)');
/**
* AuthController
*
* @module :: Controller
* @description :: Contains logic for handling auth requests.
*/
var passport = require('passport');
var GoogleStrategy = require('passport-google').Strategy;