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
#!/usr/bin/env ruby | |
# Author : Emad Elsaid (https://github.com/blazeeboy) | |
# it turns out that BBC website has a printable version of | |
# the top 40 UK singles chart, that made me jump of joy :D | |
require 'open-uri' | |
# get BBC singles chart printable version | |
page = open('http://www.bbc.co.uk/radio1/chart/singles/print').read | |
# result has data as table so we'll extract keys from TH tags |
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
# /etc/hosts | |
127.0.0.1 localhost | |
# Block traffic from these ad sites: | |
#+ doubleclick domains | |
0.0.0.0 doubleclick.net | |
0.0.0.0 www.doubleclick.net | |
0.0.0.0 cm.g.doubleclick.net | |
0.0.0.0 www.cm.g.doubleclick.net |
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
upstream php { | |
server unix:/var/run/php5-fpm.sock; | |
} | |
server { | |
# enforce NO www | |
server_name www.example.com; | |
return 301 $scheme://example.com$request_uri; | |
} |
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 | |
# Source: http://blog.stefanxo.com/2014/02/clean-up-after-docker/ | |
docker images -f dangling=true -q | xargs -r docker rmi -f #Adding -f forces removal |
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 GitHubApi = require("github"); | |
var user = "kn9ts"; | |
var pullRequests = []; | |
var github = new GitHubApi({ | |
// optional | |
debug: false, | |
protocol: "https", | |
host: "api.github.com", // should be api.github.com for GitHub | |
pathPrefix: "", // for some GHEs; none for GitHub | |
timeout: 5000, |
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
'use strict'; | |
var _ = require('lodash'); | |
var keystone = require('keystone'); | |
var range_check = require('range_check'); | |
var util = require('util'); | |
/** | |
* | |
*/ |
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
<br /><br /> | |
# React Native: Animated | |
ReactEurope 2015, Paris - Spencer Ahrens - Facebook | |
<br /><br /> | |
## Fluid Interactions | |
- People expect smooth, delightful experiences |
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
(function () { | |
var TestView = Backbone.View.extend({ | |
el: '#container', | |
initialize: function () { | |
console.log('Inside Init'); | |
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 mongo = require('mongoskin'); | |
var db = mongo.db('127.0.0.1:27017/test'); | |
// create index: | |
// key, unique, callback | |
db.collection('user').ensureIndex([['name', 1]], true, function(err, replies){}); | |
// bind method: db.user ===> db.collection('user') | |
db.bind('user'); |
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 express = require('express') | |
, mongoskin = require('mongoskin') | |
var app = express() | |
app.use(express.bodyParser()) | |
var db = mongoskin.db('localhost:27017/test', {safe:true}); | |
app.param('collectionName', function(req, res, next, collectionName){ | |
req.collection = db.collection(collectionName) |
OlderNewer