Skip to content

Instantly share code, notes, and snippets.

@jsocol
jsocol / gist:950670766ab0ddbd1e7d
Created July 18, 2014 12:37
spam source code
{
{I have|I’ve} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any
interesting article like yours. {It’s|It is} pretty worth enough for me.
{In my opinion|Personally|In my view}, if all {webmasters|site owners|website
owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more} useful than ever before.|
I {couldn’t|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I’ll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} your {rss|rss feed} as I {can not|can’t} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink}
or {newsletter|e-newsletter} service. Do {you have|you’ve} any?
@jsocol
jsocol / py2cairo.spec
Created October 14, 2013 22:14
RPM spec for py2cairo
Name: py2cairo
Version: 1.10.0
Release: 1%{?dist}
Summary: Python bindings for Cairo graphics library
Group: Development/Libraries
License: MPL1.1
URL: http://cairographics.org
Source0: http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2
@jsocol
jsocol / htpasswd.py
Created July 29, 2013 17:36
htpasswd.py that supports non-batch mode
#!/usr/bin/env python
"""Replacement for htpasswd"""
# Original author: Eli Carter
# Source: http://trac.edgewall.org/browser/trunk/contrib/htpasswd.py
import getpass
import os
import sys
import random
from optparse import OptionParser
@jsocol
jsocol / deploy_notify.py
Last active December 20, 2015 07:49
Simple Django management command to ping graphite on deploy
import socket
import time
from django.conf import settings
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
help = 'Notify stats on deploy.'
@jsocol
jsocol / lcd.sh
Created May 12, 2013 15:02
Change directories and list contents.
# I found myself doing this a lot: cd path/<enter>ls<enter> and thought "that's silly".
# Put this in your .bashrc or another file that is sourced (*not* executed) into your
# shell environment. Then you'll have the "lcd" command available.
# Change directory and list contents.
lcd () {
if [ $# -eq 1 ]; then
cd $1 && ls
elif [ $# -eq 2 ]; then
cd $2 && ls $1
@jsocol
jsocol / README.md
Created January 28, 2013 05:34 — forked from johan/README.md

The fun part of user scripting is deciding what happens. The boring part is scavenging the DOM for bits of templated data, or elements you want to mod.

Have on.js do it for you!

@jsocol
jsocol / chrome-trello.com.js
Created December 10, 2012 05:59
.js script: make trello card IDs visible
window.addEventListener("load", function() {
var ids = document.querySelectorAll("span.card-short-id");
Array.prototype.forEach.call(ids, function(el) {
el.classList.remove("hide");
});
}, false);
@jsocol
jsocol / forms.html
Created December 3, 2012 23:03
forms test
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Forms!</title>
<style>
input {
display: block;
font-size: 150%;
}
@jsocol
jsocol / gist:4067398
Created November 13, 2012 18:13
R-Type-like Multitouch UI Test
<!DOCTYPE html>
<title>Multitouch Test</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<style>
html, body {
background-color: #000;
color: #fff;
height: 100%;
@jsocol
jsocol / youtube.com.js
Created November 9, 2012 05:46
hide youtube comments with dotjs
(function(d) {
var c = d.querySelector("#watch-discussion");
c.parentNode.removeChild(c);
})(document);