Skip to content

Instantly share code, notes, and snippets.

View ChrisCates's full-sized avatar

Chris Cates ChrisCates

View GitHub Profile
// This is called with the results from from FB.getLoginStatus().
function statusChangeCallback(response) {
console.log('statusChangeCallback');
console.log(response);
// The response object is returned with a status field that lets the
// app know the current login status of the person.
// Full docs on the response object can be found in the documentation
// for FB.getLoginStatus().
if (response.status === 'connected') {
// Logged into your app and Facebook.
// grab our gulp packages
var gulp = require('gulp'),
gutil = require('gulp-util'),
exec = require('gulp-exec')
gulp.task('server', function (cb) {
exec('node app.js', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
<!-- index.html -->
<html>
<head>
<!-- Do _not_ rely on this URL in production. Use only during development. -->
<script src="falcor.browser.js"></script>
<script>
$ref = falcor.Model.ref;
var json = {
"greeting": {
9001: "hello world"
<!-- index.html -->
<html>
<head>
<!-- Do _not_ rely on this URL in production. Use only during development. -->
<script src="falcor.browser.js"></script>
<script>
$ref = falcor.ref;
var model = new falcor.Model();
model.set({
paths: [
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('gulp-browserify');
var reactify = require('reactify');
var babelify = require('babelify');
var sass = require('gulp-sass');
<h1>Hello world</h1>
chaingres
.new(client)
.table("")
.insert({
"column1": "value1",
"column2": "value2"
}).then(function(err,result) {
console.log(result);
})
async.eachSeries(dirs, function(dir, callback) {
converter = new Converter({});
var file = __dirname + path + "/" + dir;
converter.fromFile(file, function(err,csv) {
var table = dir.replace(".csv", "").toLowerCase();
var count = 0;
async.mapLimit(csv, 100, function(rows, callbackMap) {
r.db("baseball").table(table).insert(rows).then(function() {
count = count + 100;
console.log("Migrated",count,"rows");
path = "path/to/your/image"
img = cv2.imread(path, cv2.IMREAD_UNCHANGED)
x1 = 0
x2 = 0
y1 = 0
y2 = 0
fx1 = False
fx2 = False
function listener(callback) {
var objects = [1, 2, 3, 4, 5];
objects = objects.map(function(o, i) {
return o + 1;
});
// objects = [2, 3, 4, 5, 6]
return callback(objects);
}