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
// database.js file | |
var client = require("mongodb").MongoClient; | |
client.connect('mongodb://127.0.0.1:27017/foodb', function (err, db) { | |
if (err) { | |
throw err; | |
} | |
exports.users = db.collection("users"); |
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
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <limits.h> | |
#include <string.h> | |
struct entry_s { | |
char *key; | |
char *value; |
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
let s:N1 = [ '#141413' , '#aeee00' , 232 , 154 ] " blackestgravel & lime | |
let s:N2 = [ '#f4cf86' , '#45413b' , 222 , 238 ] " dirtyblonde & deepgravel | |
let s:N3 = [ '#8cffba' , '#242321' , 121 , 235 ] " saltwatertaffy & darkgravel | |
let s:N4 = [ '#666462' , 241 ] " mediumgravel | |
let s:I1 = [ '#141413' , '#0a9dff' , 232 , 39 ] " blackestgravel & tardis | |
let s:I2 = [ '#f4cf86' , '#005fff' , 222 , 27 ] " dirtyblonde & facebook | |
let s:I3 = [ '#0a9dff' , '#242321' , 39 , 235 ] " tardis & darkgravel | |
let s:V1 = [ '#e2e2e2' , '#4f3598' , 254 , 56 ] " blackestgravel & orange |
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
# **postinstall.sh** is a script executed after Debian/Ubuntu has been | |
# installed and restarted. There is no user interaction so all commands must | |
# be able to run in a non-interactive mode. | |
# | |
# If any package install time questions need to be set, you can use | |
# `preeseed.cfg` to populate the settings. | |
### Setup Variables | |
# The version of Ruby to be installed supporting the Chef and Puppet gems |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
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
#!/bin/bash -e | |
sudo pip install redis |
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
<script> | |
var ua = navigator.userAgent; | |
var checker = { | |
ios: ua.match(/(iPhone|iPod|iPad)/), | |
blackberry: ua.match(/BlackBerry/), | |
android: ua.match(/Android/), | |
windowsphone: ua.match(/Windows Phone/) | |
}; | |
$(document).ready(function() { |
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
git shortlog -s -n |
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
/* | |
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/ | |
* Better handling of scripts without supplied ids. | |
* | |
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function. | |
*/ | |
(function(doc, script) { | |
var js, | |
fjs = doc.getElementsByTagName(script)[0], |
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
// thanks to daniel walsh | |
// http://davidwalsh.name/array-sort | |
// http://dochub.io/#javascript and search for sort to see more details | |
// sort by age | |
var o = [{name : "Robin Van Persie", age: 28}, | |
{name : "Theo Walcott", age : 22}, | |
{name : "Bacary Sagna", age : 26} | |
].sort(function(obj1, obj2) { | |
return obj1.name - obj2.name; |
OlderNewer