Skip to content

Instantly share code, notes, and snippets.

$.sammy(function() {
this.helpers({
showModal: function() {
$('.modal').show('slow');
},
hideModal: function() {
$('.modal').show('slow');
}
});
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active June 18, 2024 18: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
@Daniel15
Daniel15 / 1_Twitter autoresponder bot.md
Last active December 6, 2021 20:37
Twitter autoresponder bot

Twitter autoresponder bot

By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.

Could be modified to be more advanced (match regular expressions to answer questions, etc.)

Questions? See my blog post - http://dan.cx/blog/2011/06/twitter-autoreply-bot-dbznappa

Modified 2013-06-13 - Twitter API 1.0 discontinued, modified to use Twitter API 1.1

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
@2xyo
2xyo / gif.py
Created August 1, 2012 13:12
Small script to send gif by mail...
#!/usr/bin/env python
import imaplib
from pprint import pprint
from email.parser import HeaderParser
from django.core.mail import EmailMultiAlternatives
from email.mime.message import MIMEMessage
from django.conf import settings
import os,random,sys
from email import Charset
from email.mime.image import MIMEImage
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@catwell
catwell / tech-ms.md
Last active October 10, 2015 19:58
Technologies used at Moodstocks

Technologies used at Moodstocks

We are not religious about tech. We will use whatever tool fits the use case.

meme: use all the languages

Server-side

  • Hosted on AWS cloud (EC2)
  • Image search engine: C/C++ [1] + Lua(JIT) + Ruby + Redis + MessagePack + Beanstalkd
@vjo
vjo / url_opener.py
Last active December 12, 2015 06:59
Open url with cookies
import urllib2
with open('hack_file.txt') as f:
content = f.readlines()
for id in content:
headers = {'Cookie': 'cookie1=value1; cookie2=value2; cookie3=value3;'}
url = "http://url.com/id/%s" % id
req = urllib2.Request(url, None, headers)
resp = urllib2.urlopen(req)
@cdelfosse
cdelfosse / mesagraph-push-api.html
Created February 19, 2013 14:34
Mesagraph Social TV push API example, using Javascript
<!DOCTYPE html>
<html>
<head>
<title>Push API example</title>
<style type="text/css">
.block {
background-color: #ccc;
padding: 1em;
margin: 1em;
@aras-p
aras-p / preprocessor_fun.h
Last active June 21, 2024 12:20
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,