Skip to content

Instantly share code, notes, and snippets.

@louisremi
louisremi / animLoopX.js
Created July 29, 2011 17:34
Animation loop with requestAnimationFrame
// Cross browser, backward compatible solution
(function( window, Date ) {
// feature testing
var raf = window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.msRequestAnimationFrame ||
window.oRequestAnimationFrame;
window.animLoop = function( render, element ) {
var running, lastFrame = +new Date;
@jafstar
jafstar / deck1
Created October 23, 2011 09:21
Deck of Cards
<!DOCTYPE html>
<html lang="en">
<head>
<title>Deck of Cards</title>
<meta charset="UTF-8" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
/*
* Minimal classList shim for IE 9
* By Devon Govett
* MIT LICENSE
*/
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') {
Object.defineProperty(HTMLElement.prototype, 'classList', {
get: function() {
@zanematthew
zanematthew / gist:1970589
Created March 4, 2012 03:48
WordPress Ajax Login -- Load Template
<?php
/**
* loads a template from a specificed path
*
* @package Ajax
*
* @uses load_template()
* @todo move to zm-ajax or something?
*/
function zm_load_template() {
@HenrikJoreteg
HenrikJoreteg / ajaxfileupload.js
Created April 26, 2012 19:47
AJAX file uploading using jQuery and XMLHttpRequest 2.0 and adding listener for progress updates
// grab your file object from a file input
$('#fileInput').change(function () {
sendFile(this.files[0]);
});
// can also be from a drag-from-desktop drop
$('dropZone')[0].ondrop = function (e) {
e.preventDefault();
sendFile(e.dataTransfer.files[0]);
};
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@jafstar
jafstar / HelloGo.txt
Last active February 4, 2018 16:08
Hello Go
//LINKS
https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Go
https://developers.google.com/appengine/docs/go/gettingstarted/helloworld
https://developers.google.com/appengine/docs/go/gettingstarted/uploading
//ENV VARIABLES
export GOROOT=$HOME/opt/go
export GOPATH=$HOME/Desktop/GO
@jafstar
jafstar / .htaccess
Created July 18, 2012 06:36
html5-boilerplate / .htaccess
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache config if possible
# httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
@jafstar
jafstar / radio_streams.txt
Last active May 10, 2024 08:57
Radio Streams
//ABC JAZZ
//mp3: "http://listen.radionomy.com/abc-jazz"
//FRISKY FM
//mp3: "http://scfire-mtc-aa02.stream.aol.com:80/stream/1015"
http://stream2.friskyradio.com:8000/frisky_mp3_hi
http://chill.friskyradio.com/friskychill_mp3_high
//WWOZ
//mp3: "http://wwoz-sc.streamguys.com/wwoz-hi.mp3"
@jafstar
jafstar / openshift_alias.txt
Last active October 12, 2015 18:18
Openshift Add Remove Alias
rhc app remove-alias -a myAppName --alias www.mywebsite.com
rhc app remove-alias -a myAppName --alias mywebsite.com
rhc app add-alias -a myAppName --alias www.mywebsite.com
rhc app add-alias -a myAppName --alias mywebsite.com
//NEW
rhc alias add