Skip to content

Instantly share code, notes, and snippets.

View thomasfoster96's full-sized avatar
🏠
Working from home

Thomas Foster thomasfoster96

🏠
Working from home
View GitHub Profile
@PaulReiber
PaulReiber / run
Last active May 14, 2019 19:45
Small ruby/fog program to run a linux command via ssh on all of your cloud servers, displaying the returned output from each server
#!/usr/bin/ruby
#############################################
# Ruby / Fog Cloud Server Command Runner
#
# Author: Paul Reiber reiber@gmail.com
#
# Usage: run commandline-to-run-on-all-servers
#
# Assumptions:
# * You are using the Rackspace Cloud
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@zhuowei
zhuowei / glasslabs.md
Last active December 17, 2015 14:29
Glass Labs experiments: what they do

Glass Lab Experiments

Updated: July 2nd (XE7)

Ron Amadeo of Android Police did a review of these experiments: http://www.androidpolice.com/2013/05/24/google-glasss-hidden-labs-features-ok-glass-everywhere-web-browsing-video-stabilization-and-more-video/

Google Glass has a series of Labs experiments that can be enabled on engineering or userdebug builds. Using APKTool, I've removed that restriction and now they can be enabled with root access.

To start, for example, the SOUND_SEARCH lab, type in a root shell

@paulirish
paulirish / performance.now()-polyfill.js
Last active August 1, 2023 15:42
performance.now() polyfill (aka perf.now())
// @license http://opensource.org/licenses/MIT
// copyright Paul Irish 2015
// Date.now() is supported everywhere except IE8. For IE8 we use the Date.now polyfill
// github.com/Financial-Times/polyfill-service/blob/master/polyfills/Date.now/polyfill.js
// as Safari 6 doesn't have support for NavigationTiming, we use a Date.now() timestamp for relative values
// if you want values similar to what you'd get with real perf.now, place this towards the head of the page
// but in reality, you're just getting the delta between now() calls, so it's not terribly important where it's placed
@mashpie
mashpie / i18n-node-http.js
Last active May 3, 2021 17:50
basic plain vanilla setup in node with http
// require modules
var http = require('http'),
i18n = require('i18n'),
app;
// minimal config
i18n.configure({
locales: ['en', 'de'],
directory: __dirname + '/locales'
});
@eugenehp
eugenehp / reverse-ip-lookup.js
Created July 8, 2012 14:58
node.js IP reverse lookup
var dns = require('dns');
function reverseLookup(ip) {
dns.reverse(ip,function(err,domains){
if(err!=null) callback(err);
domains.forEach(function(domain){
dns.lookup(domain,function(err, address, family){
console.log(domain,'[',address,']');
console.log('reverse:',ip==address);
@Linux-cpp-lisp
Linux-cpp-lisp / gist:2890984
Created June 7, 2012 19:20
Basic Sandboxing
require("timeout")
t=Thread.new(codeStr) do |code|
$SAFE=4
Timeout::timeout(5) {eval code} rescue nil
end
@dstroot
dstroot / install-redis.sh
Created May 23, 2012 17:56
Install Redis on Amazon EC2 AMI
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@brikis98
brikis98 / BinaryModules.js
Created December 1, 2011 00:45
Node.js performance tips
// Use built in or binary modules
var crypto = require('crypto');
var hash = crypto.createHmac("sha1",key).update(signatureBase).digest("base64");