This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var greeters = [ | |
new Greeter(new BoredGreetingStrategy()), | |
new Greeter(new PoliteGreetingStrategy()), | |
new Greeter(new FriendlyGreetingStrategy()), | |
]; | |
greeters.forEach(function(greeter) { | |
// Since each greeter knows its strategy, there's no need | |
// to do any type checking. We just greet, and the object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Taken from http://passportjs.org | |
var passport = require('passport') | |
// Each authentication mechanism is provided as an npm package. | |
// These packages expose a Strategy object. | |
, LocalStrategy = require('passport-local').Strategy | |
, FacebookStrategy = require('passport-facebook').Strategy; | |
// Passport can be instanciated using any Strategy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vim:set sw=4 sts=4: | |
package main | |
import ( | |
"io/ioutil" | |
"net/http" | |
"encoding/json" | |
"time" | |
"os/exec" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>title</title> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT COUNT(*) | |
FROM [githubarchive:github.timeline] | |
WHERE repository_language == "JavaScript" | |
AND type == "CreateEvent" | |
AND ( | |
LOWER(repository_description) CONTAINS "framework" AND ( | |
LOWER(repository_description) CONTAINS "mvc" OR | |
LOWER(repository_description) CONTAINS "mvvm" OR | |
LOWER(repository_description) CONTAINS "mvp" OR | |
LOWER(repository_description) CONTAINS "mv*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
st = status | |
ci = commit | |
co = checkout | |
di = diff | |
dc = diff --cached | |
amend = commit --amend | |
aa = add --all | |
ff = merge --ff-only | |
pullff = pull --ff-only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'), | |
gutil = require('gulp-util'), | |
spawn = require('child_process').spawn, | |
livereload = require('gulp-livereload') | |
replace = require('gulp-replace'); | |
gulp.task('staticsvr', function(next) { | |
var staticS = require('node-static'), | |
server = new staticS.Server('./'), | |
port = 2888; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const LanguageDetect = require('languagedetect'); | |
const lngDetector = new LanguageDetect(); | |
const AlgoliaIndexTransform = require('algolia-index-transform'); | |
const algoliaIndexTransform = new AlgoliaIndexTransform({ | |
sourceApplicationID: 'source_app_id', | |
sourceApiKey: 'source_key_here', | |
sourceIndexName: 'site-search', | |
destinationApplicationID: 'dest_app_id', | |
destinationApiKey: 'dest_key_here', | |
destinationIndexName: 'site-search', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import dateutil.parser | |
import pickle | |
import os.path | |
from googleapiclient.discovery import build | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from google.auth.transport.requests import Request | |
from math import ceil | |
import pandas as pd | |
import matplotlib.pyplot as plt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="input"> | |
<textarea placeholder="jeremy, guillaume..."></textarea> | |
<input type="submit" onclick="mock();"/> | |
</div> | |
<p id="output" style="white-space: pre-wrap;"> | |
</p> | |
<script> | |
function mock() { |
OlderNewer