Skip to content

Instantly share code, notes, and snippets.

View premasagar's full-sized avatar

Prem Rose premasagar

View GitHub Profile
@premasagar
premasagar / speakers.md
Last active October 11, 2015 12:18 — forked from aron/speakers.txt
Async Show and Tell

[Async's][async] [2012 International Show n' Tell][event]

Thursday 8th November, 2012

☞ [Full info on the Async website][event]
✈ Sign up to attend [on the event's Lanyrd page][event-lanyrd].

Speakers gist

Would you like to speak on the night? you’ll have five minutes on the night to tell us about something… a project, a library, a technique, a story, or anything else about JavaScript, related tech (HTML, CSS, SVG, etc), or the wider world of web.

@premasagar
premasagar / octocat.svg
Created May 29, 2012 20:54 — forked from milligramme/octocat.svg
Github octocat avatar, SVG format
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@premasagar
premasagar / gist:2659105
Created May 11, 2012 11:30 — forked from almost/gist:2659046
index.js that auto-loads other modules in same directory
var fs = require('fs'), path = require('path');
// Load all exported objects into a single module.
fs.readdirSync(__dirname).forEach(function (filename) {
var fullpath = path.join(__dirname, filename), resource,
module;
if (fullpath !== __filename && 'js' === fullpath.split('.').pop() && '.' !== fullpath[0]) {
module = require(fullpath);
exports[filename.split('.')[0]] = module;
@premasagar
premasagar / animLoopX.js
Created September 24, 2011 00:47 — forked from louisremi/animLoopX.js
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;
@premasagar
premasagar / ufo.js
Created September 12, 2011 09:49 — forked from jimpurbrick/ufo.js
An alien abductor for the asyncjs.com JavaScript Jungle.
jj.createCreature("ufo", function (creature) {
"use strict";
var captured = {},
positionFactor = 0.005,
$ = jj.jQuery,
SEARCH = 1,
CHASE = 2,
CAPTURE = 3,
RETURN = 4,
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh
@premasagar
premasagar / _gzip.js
Created August 11, 2010 17:57 — forked from bga/_gzip.js
window._gzip = (function()
{
var _matchCount = function(s, word)
{
var n = 0, wordLen = word.length, p = -wordLen;
while((p = s.indexOf(word, p + wordLen)) > -1)
++n;
return n;
http://collectionsonline.nmsi.ac.uk/grabimg.php?kv=107931 - painting; portrait
http://collectionsonline.nmsi.ac.uk/grabimg.php?kv=109011 - Isaac Newton’s reflecting telescope (replica)
http://collectionsonline.nmsi.ac.uk/grabimg.php?kv=107901 - print; portrait
http://collectionsonline.nmsi.ac.uk/grabimg.php?kv=126567 - medal
http://collectionsonline.nmsi.ac.uk/grabimg.php?kv=55342 - Metal spectacles with small thick oval lenses, as suggested
http://collectionsonline.nmsi.ac.uk/grabimg.php?kv=107052 - Newton's furnace, 1696-1727.
http://collectionsonline.nmsi.ac.uk/grabimg.php?kv=126565 - Royal Society Medal
http://collectionsonline.nmsi.ac.uk/grabimg.php?kv=122835 - Engraving: The paternal house of Sir Isaac Newton ... born 2
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name, ?depiction, ?thumbnail, ?influences, ?abstract
WHERE {
<http://dbpedia.org/resource/Isaac_Newton> rdfs:label ?name;
foaf:depiction ?depiction ;
<http://dbpedia.org/ontology/thumbnail> ?thumbnail;
<http://dbpedia.org/ontology/abstract> ?abstract.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name, ?description, ?depiction, ?thumbnail, ?scientificName
FROM <http://www.bbc.co.uk/nature/species/Black_Grouse.rdf> {
?species a <http://purl.org/ontology/wo/Species>;
rdfs:label ?name;
dcterms:description ?description;
foaf:depiction ?depiction;