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.*
<?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 \
@pjdietz
pjdietz / cloudSettings
Last active June 18, 2020 22:29
Testing Protected Method of Abstract Class with PHPUnit
{"lastUpload":"2020-06-18T22:29:09.889Z","extensionVersion":"v3.4.3"}
@bearded-avenger
bearded-avenger / easy-digital-downloads-changelog-shortcode
Last active October 19, 2020 07:06
Easy Digital Downloads - Changelog Shortcode (pass the EDD download ID and output a button that opens the changelog in a lightbox) - Completely un-styled and ready to abuse
/*
Use: [changelog id=""]
Atts: "id" is the id of the download in EDD
*/
add_shortcode('changelog','edd_changelog_sc'));
function edd_changelog_sc($atts,$content = null) {
$defaults = array(
@Rarst
Rarst / WordPress.xml
Last active August 5, 2021 04:14
WordPress Live Templates for PhpStorm
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="WordPress">
<template name="aa" value="add_action( '$hook$', '$callback$' );&#10;$END$" description="add_action" toReformat="false" toShortenFQNames="true">
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="callback" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="false" />
<option name="XML" value="false" />