Skip to content

Instantly share code, notes, and snippets.

@samrogerson
samrogerson / mus
Created March 20, 2012 14:20
Music
DatA - Rapture (Sterehoes remix)
@samrogerson
samrogerson / tilegap.patch
Created April 22, 2013 07:40
Diff for git://git.suckless.org/dwm to make "useless gap" work on 6.0. Works only in the `tile` function.
diff --git a/config.def.h b/config.def.h
index 8fd5d4a..82b010e 100644
--- a/config.def.h
+++ b/config.def.h
@@ -10,6 +10,7 @@ static const char selbgcolor[] = "#005577";
static const char selfgcolor[] = "#eeeeee";
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
+static const unsigned int tilespace = 6; /* spacing between tiles */
static const Bool showbar = True; /* False means no bar */
@samrogerson
samrogerson / nick_singleton.cpp
Last active December 18, 2015 04:49
Nick wanted static options....
class NicksClassOptions // singleton class
{
private:
// make the default constructor and the copy constructor private
// to prevent extra versions of this floating around
NicksClassOptions() {};
NicksClassOptions(const NicksClassOptions&);
// prevent people changing this
NicksClassOptions& operator=(const NicksClassOptions&);
public:
@samrogerson
samrogerson / urlstrip.c
Last active December 22, 2015 19:49
An example url protocol stripper for bryn
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
char *urlStrip(char *inputUrl, int *ret_sz) {
/* if inputUrl isn't allocated dynamically you doin't need to pass sz_url you can just do sizeof(inputUlr) */
int pos = 0;
int sz_url = strlen(inputUrl);
while(pos < sz_url - 1 && inputUrl[pos] != '/' && inputUrl[pos+1] != '/') {
/*printf("%d -> %c\n", pos, inputUrl[pos]);*/