Skip to content

Instantly share code, notes, and snippets.

View underhilllabs's full-sized avatar

Bart Lantz underhilllabs

View GitHub Profile
grep 'android:text=' res/layout/*.xml | grep -v '@string'
AlertDialog.Builder builder = new AlertDialog.Builder(NeedleView.this);
builder.setTitle(R.string.delete_dialog_title_needle)
.setMessage(R.string.delete_dialog_text_needle)
.setPositiveButton(R.string.dialog_button_delete, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
ndb.deleteNeedle(needleId);
Intent i2 = new Intent(NeedleView.this,KnittingStashHome.class);
i2.putExtra("com.underhilllabs.knitting.tabid",0);
startActivity(i2);
return;
getString(R.string.menu_shopping)
ffmpeg -an -s 600x480 -r 15 -f x11grab -i :0.0+0,25 -vcodec mpeg4 -sameq -y scast-temp.mp4
ffmpeg [-an] -s <width>x<height> -r <fps> -f x11grab -i :0.0[+<ox,oy>] -codec mpeg4 -sameq -y <temporary-file>.mp4
via:
http://polishlinux.org/linux/ubuntu/screencasts-in-ubuntu-part-2/
'''
fricks.py
count the numbers of fucks in a text file
'''
fucks=0
for line in open('Sprawl - 01 Neuromancer - William Gibson.txt'):
if "fuck" in line:
fucks+=1
print line
;; automatically set scheme-mode when opening a scheme file
(add-to-list 'auto-mode-alist '("\\.scm$" . scheme-mode))
;;; add gist mode, easily send region to github gist
;;; also retrieve list of gists in a buffer, select one and download into another buffer.
(add-to-list 'load-path "~/.emacs.d/vendor/gist.el")
(require 'gist)
sudo dpkg-reconfigure pulseaudio
google.load("wave", "1");
var wavePanel = new google.wave.WavePanel({
target: document.getElementById("myWaveDiv");
});
wave.loadWave("googlewave.com", "a_wave_id");
@underhilllabs
underhilllabs / patch cvs Drupal workflow.sh
Created June 28, 2010 16:59
patch cvs drupal workflow
mkdir drupalhead
cd drupalhead
cvs -z9 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -d drupal-cvs drupal
#install drupal via webpage
# update HEAD
cd drupalhead/drupal-cvs/
cvs update -dP
# find interesting patch to test
@underhilllabs
underhilllabs / binary_to_dec.py
Created February 5, 2011 19:25
translate binary number to decimal
# binary number to decimal
def bin_to_dec(num):
total = 0
i = 0
for dig in str(num)[::-1]:
total += int(dig) * int(pow(2,i))
i = i + 1
return total