Skip to content

Instantly share code, notes, and snippets.

@lucasmazza
lucasmazza / script.md
Created August 17, 2011 17:49
Redis 2.2 Install on Ubuntu 10.04

Installation commands:

$ wget http://redis.googlecode.com/files/redis-2.2.2.tar.gz
$ tar xvfz redis-2.2.2.tar.gz 
$ cd redis-2.2.2/
$ mkdir -p /opt/redis
$ make PREFIX=/opt/redis install
$ cp redis.conf /opt/redis/redis.conf
$ chown -R redis:redis /opt/redis
@fredrick
fredrick / README.md
Created November 22, 2011 18:17
Graylog2 Upstart Jobs

#Graylog2 Upstart

A basic set of Upstart jobs to get Graylog2 up and running quickly. Assumes MongoDB and Graylog2 installed in /opt/. Tested on Ubuntu Server 10.04 LTS, MongoDB 2.0.0, graylog2-server-0.9.5p1, and graylog2-web-interface-0.9.5p2.

#Usage

Place job definitions in /etc/init/ and then use service [job] [command] to start/stop/restart/status the services manually. On boot, the services flow into each other, only starting if dependent services have started. For more on controlling jobs or Upstart in general (a replacement for System-V init), see the cookbook.

#Author

@jalberto
jalberto / list_bootstrap.rb
Created April 16, 2012 22:33
simple-navigation render for twiter bootstrap nav-list
class ListBootstrap < SimpleNavigation::Renderer::Base
def render(item_container)
list = item_container.items.inject([]) do |list, item|
if item.html_options[:opts]
if item.html_options[:opts][:nav_header]
list << li_header(item)
elsif item.html_options[:opts][:icon]
list << li_icon(item)
end
else
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@paulirish
paulirish / gist:3098860
Created July 12, 2012 15:26
Open Conference Expectations

Open Conference Expectations

This document lays out some baseline expectations between conference speakers and conference presenters. The general goal is to maximize the value the conference provides to its attendees and community and to let speakers know what they might reasonably expect from a conference.

We believe that all speakers should reasonably expect these things, not just speakers who are known to draw large crowds, because no one is a rockstar but more people should have the chance to be one. We believe that conferences are better -- and, dare we say, more diverse -- when the people speaking are not just the people who can afford to get themselves there, either because their company paid or they foot the bill themselves. Basically, this isn't a rock show rider, it's some ideas that should help get the voices of lesser known folks heard.

These expectations should serve as a starting point for discussion between speaker and organizer. They are not a list of demands; they are a list of rea

@AndyA
AndyA / bbc-svn-million
Created November 1, 2012 15:43
BBC FM svn commit 1,000,000.
------------------------------------------------------------------------
r1000000 | **** REDACTED ****
MMMMMMMMMMMMMMMMMMMMMMMM ~MMMMMMMMMMMMMMMMMMMMMMMM NMMMMMMMMMMMMMMMMMMMMMMM7
MMMMMMIIIIIINMMMMMMMMMMM ~MMMMMMIIIIIIMMMMMMMMMMMM NMMMMMMMMMM~ ?MMMMMMMM7
MMMMMM ,MMMMMMMM ~MMMMMM ZMMMMMMMM NMMMMMM. MMMMM7
MMMMMM MMMM ZMMMMMMM ~MMMMMM MMMM MMMMMMMM NMMMMM MMMMMMM? MMMMM7
MMMMMM MMMMZ :MMMMMMM ~MMMMMM MMMM NMMMMMMM NMMMM MMMMMMMMMMMMMMMM7
MMMMMM MMM= MMMMMMMM ~MMMMMM MMM. MMMMMMMM NMMM MMMMMMMMMMMMMMMMM7
MMMMMM +MMMMMMMM ~MMMMMM ZMMMMMMMM NMMM MMMMMMMMMMMMMMMMM7
@klange
klange / _.md
Last active December 2, 2023 20:36
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le
@extraordinaire
extraordinaire / reconnecting_pdo.php
Last active June 27, 2023 11:12
Reconnectable PDO
<?php
class ReconnectingPDO
{
protected $dsn, $username, $password, $pdo, $driver_options;
public function __construct($dsn, $username = "", $password = "", $driver_options = array())
{
$this->dsn = $dsn;
$this->username = $username;
$this->password = $password;
@HHRy
HHRy / gist:6389485
Created August 30, 2013 12:48
Letter to MP

Dear Mr Lazarowicz,

I’ve recently came across the news that the UK Border Agency are trailing some new signage in centers in Glasgow and London - these signs targeting the most vulnerable asylum seekers telling to go home are, to me, disgusting.

On every chair back, and every wall, and hanging from the ceiling are signs which read “Ask about going home”, “Is life here hard? Going home is simple.” and “This plane can take you home, we can book the tickets”.

These people are here because they’re facing persecution at home and are seeking shelter and freedom here. These signs are a repulsive throwback to some of the more dark chapters of recent European history and have no place in a compassionate, modern democracy.

I urge you to please do what you can to end this demeaning practice.

@oddskool
oddskool / parse_aws_s3_billing.py
Created September 10, 2013 07:00
Simplistic script to parse the detailed AWS billing CSV file. Script displays cost of S3 operations broken down per region, bucket and usage type (either storage or network). It also sums up the amount of storage used per bucket. Output is filtered wrt to costs < 1$. See http://docs.aws.amazon.com/awsaccountbilling/latest/about/programaccess.html
# -*- coding:utf-8 -*-
'''
Simplistic script to parse the detailed AWS billing CSV file.
Script displays cost of S3 operations broken down per region, bucket and usage
type (either storage or network). It also sums up the amount of storage used per bucket.
Output is filtered wrt to costs < 1$.
See http://docs.aws.amazon.com/awsaccountbilling/latest/about/programaccess.html for
how to set up programmatic access to your billing.