Skip to content

Instantly share code, notes, and snippets.

@davidboy
davidboy / app_indicator.c
Created June 24, 2011 17:18
Awsum C niceness!
#include <gtk/gtk.h>
#include <libappindicator/app-indicator.h>
int main (int argc, char **argv) {
gtk_init(&argc, &argv);
GtkWidget *menu;
GtkWidget *menu_item;
AppIndicator *indicator;
using Gtk;
using WebKit;
public class CatbirdWindow : Window {
private WebView web_view;
public CatbirdWindow () {
this.title = "Catbird";
set_default_size (800, 600);
@davidboy
davidboy / catbird.gemspec
Created August 10, 2011 23:41
Derptastic
require 'rake'
gem_files = FileList[
'src/models/*.rb', 'src/public/*.png', 'src/views/*.erb',
'src/app.rb', 'src/config.ru',
'catbird', 'catbird-gui.vala', 'extconf.rb'
]
Gem::Specification.new do |s|
s.name = 'catbird'
@davidboy
davidboy / csvtest.rb
Created May 10, 2012 22:18
CSV hackyness
require 'csv'
CSV.read('results_formatted_copy.csv').each do |row|
puts row.class
end
Using https://raw.github.com/libgit2/luagit2/master/lua-git2-scm-0.rockspec... switching to 'build' mode
Cloning into 'luagit2'...
remote: Counting objects: 60, done.
remote: Compressing objects: 100% (38/38), done.
remote: Total 60 (delta 32), reused 38 (delta 20)
Receiving objects: 100% (60/60), 52.90 KiB, done.
Resolving deltas: 100% (32/32), done.
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/pre_generated-git2.nobj.c -o src/pre_generated-git2.nobj.o
src/pre_generated-git2.nobj.c: In function ‘odb_backend_read_cb’:
src/pre_generated-git2.nobj.c:1264:11: error: ‘GIT_ENOMEM’ undeclared (first use in this function)
@davidboy
davidboy / bugs.php
Created June 3, 2012 17:55
Bitesize!
<?php
# This is the address of the page we want to load on the launchpad api.
$addr = "https://api.staging.launchpad.net/1.0/elementary/?ws.op=searchTasks&tags=bitesize&status=Confirmed&status=Triaged";
# Connect to the launchpad api.
$file = fopen($addr, "r") or die('fail');
# Download and decode the json.
$bugs = json_decode(fgets($file))->entries;
@davidboy
davidboy / conversion.php
Created June 6, 2012 16:03
markdown editor
$this->load->library('markdown');
$html = $this->markdown->convert("some markdown code");
@davidboy
davidboy / gist:3137309
Created July 18, 2012 16:29
zomg yes!
davidboy@ve:~/statbot/data$ grep "\"total_mins:2:\d+\":\d+" counters --only-matching --perl-regexp
"total_mins:2:1":60
"total_mins:2:2":60
"total_mins:2:3":60
"total_mins:2:4":60
"total_mins:2:5":60
"total_mins:2:6":60
"total_mins:2:7":60
"total_mins:2:8":60
"total_mins:2:9":60
def foo(argument)
array = []
some_loop.each do |i|
array[i] = { child: foo new_argument }
end
end
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="other_window">
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>