This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# allegedly these bits can be done in a per-user default.pa, but i could not | |
# get it to work | |
pactl upload-sample /home/cmr/sounds/bells/soothingbell.wav soothingbell | |
pactl load-module module-x11-bell sample=soothingbell | |
# the default bell volume on my system is very quiet, but you should adjust this | |
xset b 100 | |
# ...but the default output volume on my system is very loud. allegedly this can | |
# also be done in default.pa, but i could not get it to work even with pactl. | |
amixer -D pulse sset Master 50% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import urllib | |
import os | |
import argparse | |
import flickrapi | |
api_key = '367aed513876077c1cdcadb29d88ef02' | |
api_secret = '9b6e223653519900' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ctype.h> | |
#include <stdio.h> | |
void hexdump(void *ptr, int buflen) { | |
unsigned char *buf = (unsigned char*)ptr; | |
int i, j; | |
for (i=0; i<buflen; i+=16) { | |
printf("%06x: ", i); | |
for (j=0; j<16; j++) | |
if (i+j < buflen) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
for i in range(0, 100): | |
if not i % 15: | |
random.seed(1178741599) | |
print [i+1, "Fizz", "Buzz", "FizzBuzz"][random.randint(0,3)] |