Skip to content

Instantly share code, notes, and snippets.

View ypid's full-sized avatar

Robin Schneider ypid

View GitHub Profile
@creationix
creationix / chatServer.js
Created November 19, 2010 20:47
A simple TCP based chat server written in node.js
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client
@ymirpl
ymirpl / gist:1052094
Created June 28, 2011 20:21
Python unicode e-mail sending
#coding: utf-8
from cStringIO import StringIO
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header
from email import Charset
from email.generator import Generator
import smtplib
# Example address data
@davatron5000
davatron5000 / gist:2254924
Created March 30, 2012 20:57
Static Site Generators

Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.

Ruby

@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:

@nikolaplejic
nikolaplejic / gist:3654637
Created September 6, 2012 10:36
How to copy/paste your password in PayPal's change password form
PayPal blocks copy/paste actions in their "change password" form,
citing some irrelevant security issues as the reason. That's a
load of crap, and they know it -- disabling copy/paste makes it a
lot harder to use a decent password generator and a lot easier to
screw up your pwd when retyping, especially if it's a long one
(as it should be!).
So, here's the quick'n'dirty way to use an externally generated
password in your PayPal account:
@henrik
henrik / README.md
Created September 30, 2012 17:19
Automatically posting new Zendesk tickets to HipChat.
@mattpascoe
mattpascoe / leasecheck.pl
Last active September 17, 2018 16:30
Perl script to parse ISC DHCP lease file and display basic info. I dont recall if I wrote this or if I found it on the interwebs somewhere!?!?.. a quick goog search did not find it but hey its useful so have at it.
#!/usr/bin/perl
#
# Update the path to your lease file below
use strict;
use File::Copy;
#use DateTime;
#always parse a copy not the live file
#my $leasefile = '/var/lib/dhcpd/dhcpd.leases';
my $leasefile = '/var/lib/dhcp/db/dhcpd.leases';
// the location we want to GeoCode
var location = 'London';
// we are using MapQuest's Nominatim service
var geocode = 'http://open.mapquestapi.com/search?format=json&q=' + location;
// use jQuery to call the API and get the JSON results
$.getJSON(geocode, function(data) {
// get lat + lon from first match
var latlng = [data[0].lat, data[0].lon]
#!/usr/bin/python
#
# use avahi to find a _apt_proxy._tcp provider and return
# a http proxy string suitable for apt
import socket
from subprocess import Popen, PIPE
def is_ipv6(a):
@SebAshton
SebAshton / github-badges.md
Last active September 28, 2018 01:09
Available Github Badges
Badge Description Free for OSS Languages
Coveralls Code Coverage Yes Ruby, Python, PHP, Node, C/C++, Java, Scala, Go
Gemnasium Dependancy Monitoring Yes Ruby (RubyGems), Node (NPM)
Crate Num of Downloads ? Python
Brakeman Security Yes RoR
Code Climate Code Review Yes Ruby, Javascript
Version Badge Package Version Yes Ruby, Python, Node
Travis CI Continuous Integration Yes C/C++, Clojure, Erlang, Go, Groovy, Haskell, Java, Jav