Skip to content

Instantly share code, notes, and snippets.

@addyosmani
addyosmani / visibly.js
Created August 3, 2011 12:44
Cross-browser Page Visibility API polyfill
/*!
* isVis - v0.5.5 Aug 2011 - Page Visibility API Polyfill
* Copyright (c) 2011 Addy Osmani
* Dual licensed under the MIT and GPL licenses.
*/
(function () {
window.visibly = {
b: null,
q: document,
@iwek
iwek / html5-blank-template
Created January 19, 2013 03:50
HTML5 Blank Template with jQuery
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Blank HTML5</title>
<style>
</style>
</head>
<body>
@eric1234
eric1234 / fm.php
Created October 19, 2010 21:38
Very simple file manager
<?php
/*** A stupid simple PHP-based file manager ***/
// Were to put the files. Assume the "fm" directory where this script
// Is located but you can change it to anything you want.
$storage_dir = implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'fm'));
// Set to the name of the file that is the header and footer of the HTML
$header = null;
$footer = null;
@lsauer
lsauer / gist:2907369
Last active January 17, 2022 09:59
Google Chrome special pages for memory, debug, resources, profiling, downloads...

####lsauer.com


###Overview of all chrome:// pages.

  • List by calling chrome://about/
  • Following is a direct dump from the 'about' page for reference

###List of Pages as per v20.xxx

@CaptainN
CaptainN / jquery.mobile.just-touch.js
Created March 29, 2012 20:06
Just touch events for jQuery
// This is a combination of two modified files from jQuery Mobile,
// jquery.mobile.vmouse.js and jquery.mobile.event.js
// They were modified to only provide the touch event shortcuts, and
// avoid the rest of the jQuery Mobile framework.
// The normal jQuery Mobile license applies. http://jquery.org/license
//
// This plugin is an experiment for abstracting away the touch and mouse
// events so that developers don't have to worry about which method of input
// the device their document is loaded on supports.
//
@kevinswiber
kevinswiber / hal.json
Created July 7, 2012 14:56
JSON Siren vs. HAL Representations
{
"_links": {
"self": { "href": "/orders" },
"next": { "href": "/orders?page=2" },
"find": { "href": "/orders{?id}", "templated": true }
},
"_embedded": {
"orders": [{
"_links": {
"self": { "href": "/orders/123" },
@bellbind
bellbind / index.html
Created February 13, 2012 08:41
[facebook][javascript][nodejs]using facebook javascript sdk
<!doctype html>
<html>
<head>
<title>Facebook Canvas Page with JavaScript SDK</title>
</head>
<body>
<h1>Hello Facebook JS SDK</h1>
<!-- put fnb-root and initialize script for using Facebook JavaScript SDK -->
<div id="fb-root"></div>
<script>
@dannvix
dannvix / lat-lng-to-addr.py
Last active December 15, 2015 17:39
convert latitude & longitude to formatted address with Google Maps API
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import sys, traceback
import json, urllib2
def latlng_to_addr (lat, lng):
# convert given latitude & longitude to formatted address with Google Maps API
# ref: http://techslides.com/convert-latitude-and-longitude-to-a-street-address/
maps_api_url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=%s,%s&sensor=false' % (lat, lng)
try:
@justinrosenthal
justinrosenthal / statsd-graphite-setup.sh
Created October 11, 2012 06:33
Setup for statsd on Ubuntu ec2
##################
# INSTALL STATSD
##################
sudo apt-get install git-core python-software-properties build-essential
sudo apt-get -y install python-software-properties debhelper
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get -y install nodejs npm
@cfaulkingham
cfaulkingham / server.js
Created June 30, 2011 15:48
This example shows how to setup up a web server on port 8000 and fetch 10 results from a mysql database and outputing the results in html
// Hacked together from http://utahjs.com/2010/09/22/nodejs-and-mysql-introduction/
// Colin Faulkingham
// This example shows how to setup up a web server on port 8000
// and fetch 10 results from a mysql database and outputting those results to HTML
//
// Version 2.0
// I cleaned up the code to be more readable.