Skip to content

Instantly share code, notes, and snippets.

# Return a list of tuples containing string representations of, and references to, OBJECT's methods
import inspect
inspect.getmembers(OBJECT, predicate=inspect.ismethod)
@dheaney
dheaney / nbc.c
Created August 31, 2013 18:13
NBC sound with libao and C
/*
*
* nbc.c
*
* Modified by DJ Heaney - August 2013
* Original code (public domain) by Stan Seibert - July 2001
*
* Legal Terms:
*
* This source file is released into the public domain. It is
date = new Date().toString().split ' '
console.log date[0] + ', ' + date[1] + ' ' + date[2] + ' ' + date[3] + ' ' + date[4] + ' '+ '-0600'
# => Tue, Jul 16 2013 11:48:42 -0600
static void spawnAboutDialog(GtkWidget *emitter, GtkWidget *aboutDialog);
GtkWidget *help;
GtkWidget *helpmenu;
GtkWidget *aboutButton;
GtkWidget *aboutDialog;
helpmenu = gtk_menu_new();
help = gtk_menu_item_new_with_mnemonic("_Help");
aboutDialog = gtk_image_menu_item_new_from_stock(GTK_STOCK_ABOUT, accel_group);
#include <stdio.h>
#include <stdlib.h>
int main() {
printf("%s/.gtktactoe/config.json\n", getenv("HOME"));
}
/* engine.c */
int indexToBoard(int index) {
int row, col;
row = index / 3;
col = index % 3;
return board[row][col];
}
<style type="text/css">
body {
background-color: rgb(255, 45, 45);
}
table {
margin-top: 50px;
border-width: 0;
border-style: none;
require 'sinatra'
require 'rqrcode'
contact = "MECARD:N:Guy Fawkes;ADR:123 Gunpowder Rd, Walworth, England 123456;EMAIL:dumby@gmail.com;URL:http://google.com;;"
get '/' do
@qr = RQRCode::QRCode.new(contact, :size => 10, :level => :l)
erb :index
end
@dheaney
dheaney / Air1.js
Last active December 14, 2015 06:48
Air1.js
#!/usr/bin/env phantomjs
// Copyright (C) 2013 - dejay
//
// Air1.js is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Air1.js is distributed in the hope that it will be useful,
@dheaney
dheaney / process.sh
Created February 24, 2013 06:05
Using the GCC preprocessor
#$file must have the ".c" extension
gcc -w -E $file -o $output