Skip to content

Instantly share code, notes, and snippets.

@andyfoster
andyfoster / bit-reverse.js
Last active September 7, 2015 00:16 — forked from tleunen/bit-reverse.js
Function to reverse the bits of a given integer
function bitRev(N) {
var r = 0;
val = 0;
while(N > 0) {
val = N&1;
N >>= 1;
r += val&1;
r <<= 1;
@andyfoster
andyfoster / README.md
Last active September 22, 2015 03:56 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@andyfoster
andyfoster / gist:ee55ead1df132222321a
Last active November 10, 2015 20:23
Created via API
We couldn’t find that file to show.
@andyfoster
andyfoster / testfile1.txt
Created November 2, 2015 05:02
Using Postman to write to API
I'm some content
@andyfoster
andyfoster / 0_reuse_code.js
Created November 2, 2015 20:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@andyfoster
andyfoster / curl.md
Created November 3, 2015 01:12 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@andyfoster
andyfoster / weather.rb
Created November 21, 2015 00:33 — forked from dan-c-underwood/weather.rb
Alternate version (with Emoji) of the Today-Scripts weather script.
require "json"
require "net/http"
require "colorize"
def formatTemp(temp)
temp_i = temp.to_i
temp = temp + "°C"
case
when temp_i <= 0
temp.colorize(:blue)
@andyfoster
andyfoster / dabblet.css
Created November 24, 2015 08:21 — forked from ggamel/dabblet.css
FizzBuzz with CSS
/**
* FizzBuzz with CSS
*/
body {
counter-reset: fizzbuzz;
}
div {
@andyfoster
andyfoster / dabblet.css
Created November 24, 2015 08:22 — forked from jackie/dabblet.css
FizzBuzz with CSS
/**
* FizzBuzz with CSS
*/
body {
counter-reset: fizzbuzz;
}
div {
@andyfoster
andyfoster / fourSquareAPI.js
Created December 31, 2015 03:45 — forked from molinto/fourSquareAPI.js
Titanium FourSquare API Integration
/*
Author: James Shrager (@jshrager)
Intended use: Appcelerator Titanium
Usage: http://www.LearningTitanium.com (@learningTi)
*/
var client_id = "YOUR_CLIENT_ID";
var client_secret = "YOUR_CLIENT_SECRET";
var redirectUri = 'http://YOUR_URL/foursquareCallback.php';
var ui = require('ui/ui');