To diff directories recursively: diff -rupN -x .svn old-dir new-dir > my.patch
To patch: patch -p1 < my.patch
To type a linefeed in emacs (for example, in replace-string
): C-q C-j
An Ant rule for restarting Tomcat when building a GWT app: | |
<target name="deploy" depends="war" description="Copy WAR file to Tomcat"> | |
<property name="apache.home" | |
location="/home/dominicc/apache-tomcat-6.0.18" /> | |
<exec executable="${apache.home}/bin/shutdown.sh" /> | |
<delete dir="${apache.home}/webapps/TestApp" failonerror="false" /> | |
<copy todir="${apache.home}/webapps" file="TestApp.war" /> | |
<exec executable="${apache.home}/bin/startup.sh" /> | |
</target> |
#!/bin/bash | |
# Parses git log and finds the commit with the specified svn change | |
# number. | |
git log | awk "/^commit / {c=\$2} /git-svn-id:.*@$1 / {print c}" | |
# This is obsoleted by git svn find-rev rNNNN |
REM Raymond Chen's replacement for Unix 'which' | |
@for %%e in (%PATHEXT%;.DLL) do @for %%i in (%1%%e) do @if NOT "%%~$PATH:i"=="" | |
echo %%~$PATH:i |
Run DumpRenderTree the way new-run-webkit-tests Does It | |
See Tools/Scripts/webkitpy/layout_tests/port/driver.py, Driver._start <http://code.google.com/searchframe#OAMlx_jo-ck/src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/driver.py&type=cs&l=273> | |
Debug GC Issues in Chrome | |
Run Chrome with: | |
--js-flags=--expose_gc |
Preamble:
Pkg.add("Gadfly")
Pkg.add("Cairo")
using Gadfly
Dot diagram:
xs = [17.8, 14.3, 15.8, 18.0, 20.2]
plot(x=xs, y=zeros(length(xs)), Geom.point)
Dot diagram:
xs = c(17.8, 14.3, 15.8, 18.0, 20.2)
stripchart(xs)
Histogram:
xs = c(6.5, 2.1, 4.4, 4.7, 5.3, 2.6, 4.7, 3.0, 4.9, 4.7,
8.6, 5.0, 4.9, 4.0, 3.4, 5.6, 4.7, 2.7, 2.4, 2.7,
2.2, 5.2, 5.3, 4.7, 6.8, 4.1, 5.3, 7.6, 2.4, 2.1,
<!DOCTYPE html> | |
<style> | |
canvas { | |
width: 640px; | |
height: 480px; | |
background: black; | |
} | |
</style> | |
<title>80 COLUMN GRAPHICS</title> | |
<canvas></canvas> |
<!DOCTYPE html> | |
<style> | |
canvas { | |
width: 1000px; | |
height: 1000px; | |
background: black; | |
} | |
</style> | |
<canvas width="1000" height="1000"></canvas> | |
<script> |
#!/bin/bash | |
# Adapted from http://danielj.se/2012/09/09/how-to-live-stream-your-ubuntu-desktop/ | |
INRES="2560x1440" # input resolution | |
OUTRES="1920x1080" | |
OFFSET="0,0" | |
FPS="15" # target FPS | |
QUAL="fast" # one of the many FFMPEG preset | |
URL="rtmp://a.rtmp.youtube.com/live2/${STREAM_KEY:?You need to set STREAM_KEY.}" | |
avconv -f x11grab -s "$INRES" -r "$FPS" -g $(expr $FPS / 4 + 1) \ |