Skip to content

Instantly share code, notes, and snippets.

@DForshner
DForshner / jQueryParallelSequentialPromises.css
Last active May 7, 2018 05:20
jQuery - Parallel and Sequential Promises
ul {
list-style-type: disc;
margin:0 0 0 2em;
}
li {
margin:0 0 .5em;
}
body {
font-family: "Verdana";
@grantslatton
grantslatton / hngen.py
Last active September 27, 2021 11:07
A program that uses Markov chains to generate probabilistic Hacker News titles.
import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"
@pseudosavant
pseudosavant / declareGlobalVariables.js
Last active October 1, 2023 21:51
Explicitly declare global variables inside an immediately invoked function expression (IIFE).Benefits:1. It is very obvious when you are intending to export a variable from a function.2. You can create global variables and your static code analyzer (JSLint/JSHint) won't complain.
(function(global){
var x = 2,
y = Math.pow(x, 2);
global.z = y;
})(this);
console.log(x); // undefined
console.log(y); // undefined
console.log(z); // 4
@insin
insin / contactform.js
Last active June 21, 2025 08:07
React contact form example
/** @jsx React.DOM */
var STATES = [
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI',
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS',
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR',
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'
]
var Example = React.createClass({
@MotionDesignStudio
MotionDesignStudio / google_voice_sms.py
Last active August 30, 2023 09:50
Mass Texting (SMS) Messaging Via Google Voice And Python
#!/usr/bin/env python
import sys
from googlevoice import Voice
from googlevoice.util import input
sys.dont_write_bytecode = True
username=str(sys.argv[1]).strip()
password=str(sys.argv[2]).strip()
@MotionDesignStudio
MotionDesignStudio / ascii_movie_image_ver_1.py
Last active January 23, 2025 08:37
Python ASCII Video And ASCII Image Creator
#!/usr/bin/env python
import sys
import cv2
import subprocess
from subprocess import call
import aalib
import Image
@andreazevedo
andreazevedo / install_mono.sh
Last active November 12, 2021 02:51
Install mono on centOS 6.x
$ yum install bison gettext glib2 freetype fontconfig libpng libpng-devel libX11 libX11-devel glib2-devel libgdi* libexif glibc-devel urw-fonts java unzip gcc gcc-c++ automake autoconf libtool make bzip2 wget
$ cd /usr/local/src
$ wget http://download.mono-project.com/sources/mono/mono-3.2.8.tar.bz2
$ tar jxf mono-3.2.8.tar.bz2
$ cd mono-3.2.8
@phoenix24
phoenix24 / gist:10457482
Created April 11, 2014 10:44
Quotes from NotePad++
http://svn.tuxfamily.org/viewvc.cgi/notepadplus_repository/trunk/PowerEditor/src/Notepad_plus.cpp?revision=1216&view=markup#5242
Quote quotes[nbQuote] = {
5242 {"Notepad++", "Good programmers use Notepad++ to code.\nExtreme programmers use MS Word to code, in Comic Sans, center aligned."},
5243 {"Martin Golding", "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."},
5244 {"L. Peter Deutsch", "To iterate is human, to recurse divine."},
5245 {"Seymour Cray", "The trouble with programmers is that you can never tell what a programmer is doing until it's too late."},
5246 {"Brian Kernighan", "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."},
5247 {"Alan Kay", "Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute
@zhangxu
zhangxu / tmux everyday usage
Last active October 27, 2017 10:09
Tmux usage
default prefix: Ctrl+b
start new session: tmux
list sessions: tmux ls
attach to session: tmux attach [-t <session>]
attach to session forcely: tmux attach -d
detach: prefix then d
Windows:
@v21
v21 / Extensions.cs
Created May 20, 2014 10:52
List extensions in c#
using System.Linq;
using UnityEngine;
using System;
using System.Collections.Generic;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;
using Random = UnityEngine.Random;
public static class Extensions
{