Skip to content

Instantly share code, notes, and snippets.

View chyld's full-sized avatar
:electron:
import numpy

Chyld Medford chyld

:electron:
import numpy
View GitHub Profile
@chyld
chyld / email.js
Created March 12, 2014 03:48
send email from node.js
'use strict';
var request = require('request');
var fs = require('fs');
var jade = require('jade');
exports.sendWelcome = function(data, fn){
send({from:'[email protected]', to:data.to, subject:'Welcome to AirBnB', template:'welcome'}, fn);
};
function initMap(lat, lng, zoom){
var mapOptions = {center: new google.maps.LatLng(lat, lng), zoom: zoom, mapTypeId: google.maps.MapTypeId.ROADMAP};
map = new google.maps.Map(document.getElementById('map'), mapOptions);
}
function addMarker(location){
var position = new google.maps.LatLng(location.lat, location.lng);
var marker = new google.maps.Marker({map:map, position:position, title:location.address});
markers.push(marker);
}
exports.db = function(fn){
MongoClient.connect(mongoUrl, function(err, db) {
if(err){throw err;}
global.nss = {};
global.nss.db = db;
global.nss.db.collection('listings').ensureIndex({'coordinates':'2dsphere'}, function(err, indexName){
console.log('Connected to MongoDB');
fn();
});
});
install java
sudo npm install -g protractor
sudo webdriver-manager update
touch root/test/protractor.conf.js
exports.config = {
specs: [
'./e2e/**/*.spec.js'
],
baseUrl: 'http://localhost:4000'
txtblk='\[\e[0;30m\]' # Black
txtred='\[\e[0;31m\]' # Red
txtgrn='\[\e[0;32m\]' # Green
txtylw='\[\e[0;33m\]' # Yellow
txtblu='\[\e[0;34m\]' # Blue
txtpur='\[\e[0;35m\]' # Purple
txtcyn='\[\e[0;36m\]' # Cyan
txtwht='\[\e[0;37m\]' # White
txtrst='\[\e[0m\]' # Text Reset
@chyld
chyld / info
Created April 8, 2014 23:19
js extreme scrabble
https://drive.google.com/#folders/0B4iPWDqbzCMARlQtQWFNUXc5TTA
'use strict';
module.exports = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// ---------------------------------------------------------------------- //
watch: {
code: {
files: ['app/js/es6/**/*.js', 'app/js/es5/**/*.js', 'Gruntfile.js'],
tasks: ['jshint:all', 'copy:es6', 'copy:es5', 'traceur']
{
"name": "client-template",
"version": "0.0.1",
"private": true,
"scripts":{
"start": "node app.js;",
"traceur": "git clone https://github.com/google/traceur-compiler tools/traceur-compiler;cd tools/traceur-compiler;npm install;cp bin/traceur.js ../../app/js/vendor;",
"nss": "atom;npm install;npm run traceur;grunt build;PORT=3000 node app.js;"
},
"dependencies":{
{
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": "nofunc",
"newcap": true,
"noarg": true,
"noempty": true,
.DS_Store
node_modules/
public/
tools/traceur-compiler/
traceur.js