Skip to content

Instantly share code, notes, and snippets.

View matjaz's full-sized avatar
:octocat:

Matjaž Lipuš matjaz

:octocat:
View GitHub Profile
@mattkatz
mattkatz / judge_droid.py
Created March 30, 2010 18:41
Judge Droid Lays Down the Law
"""
Lays down the law for your phone, telling it what to do and when
Inspired by docblades' silent_night.py
"""
import android, string, time, math, datetime
from datetime import time, datetime, timedelta
from time import sleep
from threading import Timer
droid = android.Android()
interval_secs = 480
/**
* Sanitize URL Validate it looks like a URL, then make it less dirty.
*
* Oddnut Software
* Copyright (c) 2010 Eric Ferraiuolo - http://eric.ferraiuolo.name
* MIT License - http://www.opensource.org/licenses/mit-license.php
*
* Examples:
*
* 'Http://WWW.example.com/' » 'http://www.example.com/'
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active October 27, 2025 08:27
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
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 https://www.npmjs.org/install.sh | sh
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.0/build/reset-fonts-grids/reset-fonts-grids.css&2.8.0/build/base/base-min.css">
</head>
<body class="yui-skin-sam">
<div id="doc" class="yui-t7">
@pgte
pgte / app.js
Created December 3, 2010 16:25
Node Tuts episode 12
var express = require('express');
var multipart = require('multipart');
var fs = require('fs');
var app = express.createServer();
app.configure(function() {
app.use(express.logger());
app.use(express.bodyDecoder());
app.use(express.methodOverride());
@cowboy
cowboy / pubsub-demo.js
Created December 16, 2010 20:04 — forked from rmurphey/pubsub-demo.js
Two approaches: "Traditional" vs Pub/Sub (via rmurphey)
// Note that this uses my Pub/Sub implementation, which is slightly different than
// phiggins' in that jQuery custom events are used, and as such the first event handler
// argument passed is the event object.
//
// jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery
// https://gist.github.com/661855
// The "traditional" way.
@remy
remy / audiosprite.js
Created December 23, 2010 13:54
An example of how an audio sprite can be used (includes fixes for iOS)
function Track(src, spriteLength, audioLead) {
var track = this,
audio = document.createElement('audio');
audio.src = src;
audio.autobuffer = true;
audio.load();
audio.muted = true; // makes no difference on iOS :(
/* This is the magic. Since we can't preload, and loading requires a user's
input. So we bind a touch event to the body, and fingers crossed, the
import os
import sys
import time
from os.path import join as pjoin
import warnings
warnings.filterwarnings('ignore')
sys.path.insert(0, '/Users/kami/Projects/Programming/Python/libcloud-trunk')
https://docs.google.com/present/edit?id=0Aa_f3QdXM5lYZGRyemZncTdfNGRqdDI3Y2ho&hl=en
https://gist.github.com/964654
https://gist.github.com/964925
@streunerlein
streunerlein / gist:3332181
Created August 12, 2012 14:58
NPM Mirrors & Proxies

Definition

Mirrors: standalone servers with complete copy of npm registry

Proxies: proxy to the database (couchdb) of npm registry, if only the npm registry server fails but the db works

## HowTo See this gist: https://gist.github.com/3331671

Mirrors

(+) means server is self updating (pulls newest stuff from offical registry when back online again)