Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / BKTree.hs
Created March 7, 2010 19:25
module Data.BKTree (
BKTree,
MetricSpace(..),
empty,
null,
size,
singleton,
insert,
query,
anonymous
anonymous / gist:398234
Created May 12, 2010 05:16
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/top_control_bar">
<Spinner android:id="@+id/sort_by" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:entries="@array/default_sorts" />
</RelativeLayout>
<LinearLayout android:id="@+id/bottom_control_bar"
@stephenmcd
stephenmcd / sloc.py
Last active September 5, 2015 10:54
SLOC and comment stats
import os, sys
c_like = {"single": "//", "multi_start": ("/*",), "multi_end": ("*/",),}
langs = {
"py": {"single": "#", "multi_start": ("'''", '"""'),
"multi_end": ("'''", '"""'),},
"html": {"single": "//", "multi_start": ("<!--", "/*"),
"multi_end": ("-->", "*/"),},
"js": c_like,
@sudar
sudar / dotdeb.sh
Created January 25, 2011 16:48
Adding dotdeb repository to apt-get source list to install PHP 5.3.x. More details at http://sudarmuthu.com/blog/2011/01/25/installing-php-5-3-x-in-ubuntu-through-apt-get-or-aptitude.html
gpg --keyserver keys.gnupg.net --recv-key 89DF5277
gpg -a --export 89DF5277 | sudo apt-key add -
@dcrosby42
dcrosby42 / mk_arduino_tags.sh
Created July 25, 2011 03:18
Shell script to generate Arduino ctags
ctags -f tags.cpp `find . -name "*.cpp" -o -name "*.h"`
ctags -f tags.pde --langmap=c++:.pde `find . -name "*.pde"`
cat tags.cpp tags.pde > tags
sort tags -o tags
rm -f tags.*
@chrismeyersfsu
chrismeyersfsu / oscilloscope.c
Last active January 7, 2024 14:15
Arduino Poor man's oscilloscope processing code
/*
* Oscilloscope
* Gives a visual rendering of analog pin 0 in realtime.
*
* This project is part of Accrochages
* See http://accrochages.drone.ws
*
* (c) 2008 Sofian Audry (info@sofianaudry.com)
*
* This program is free software: you can redistribute it and/or modify
@stephenh1988
stephenh1988 / simple-admin-page.php
Created September 8, 2012 15:59
A simple class based on a tutorial at WP.Tuts that creates an page with metaboxes.
<?php
/*
Description: A simple class based on a tutorial at WP.Tuts that creates an page with metaboxes.
Author: Stephen Harris
Author URI: http://www.stephenharris.info
*/
/* Copyright 2011 Stephen Harris (contact@stephenharris.info)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@kasparsd
kasparsd / wordpress-plugin-svn-to-git.md
Last active April 17, 2024 12:35
Using Git with Subversion Mirroring for WordPress Plugin Development
<?php
/*
Plugin Name: Easy Digital Downloads - Variable Pricing License Activation Limits
Plugin URL: http://easydigitaldownloads.com/extension/
Description: Limit the number of license activations permitted based on variable prices
Version: 1.0
Author: Pippin Williamson
Author URI: http://pippinsplugins.com
Contributors: mordauk
*/
@remcotolsma
remcotolsma / gist:5335793
Created April 8, 2013 10:26
Command for creating .POT file for the Pronamic iDEAL plugin.
find . -iname "*.php" -type f | xgettext \
--from-code=UTF-8 \
--keyword=__ \
--keyword=_e \
--keyword=_n:1,2 \
--keyword=_x:1,2c \
--keyword=_ex:1,2c \
--keyword=_nx:1,2,4c \
--default-domain=pronamic_ideal \
--language=PHP \