Skip to content

Instantly share code, notes, and snippets.

@dscho
dscho / ao_coreaudio.c.patch
Created Feb 25, 2014
Patch for MPlayer's C99 for loops declaring variables
View ao_coreaudio.c.patch
diff --git a/libao2/ao_coreaudio.c b/libao2/ao_coreaudio.c
index 34374f4..ce587db 100644
--- a/libao2/ao_coreaudio.c
+++ b/libao2/ao_coreaudio.c
@@ -368,7 +368,7 @@ static void print_help(void)
{
OSStatus err;
UInt32 i_param_size;
- int num_devices;
+ int num_devices, i;
View kill-process-tree.c
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <tlhelp32.h>
static int get_process_tree(DWORD *list, int len, int max_len)
{
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
PROCESSENTRY32 entry;
int i;
@dscho
dscho / Recorder_Likes_DialogListeners.java
Created May 8, 2015
A simple test for the claim that `Plugin`s with `DialogListener`s are not macro-recordable.
View Recorder_Likes_DialogListeners.java
import ij.IJ;
import ij.gui.DialogListener;
import ij.gui.GenericDialog;
import ij.plugin.PlugIn;
import java.awt.AWTEvent;
/**
* A simple test for the claim that {@link Plugin}s with a
* {@link DialogListener} are not macro-recordable.
View gist:165418
set debugfd [open "debug.txt" w]
rename proc _proc
_proc proc {name arglist body} {
uplevel 1 [list _proc $name $arglist $body]
uplevel 1 [list trace add execution $name enterstep [list ::proc_start $name]]
}
_proc proc_start {name command op} {
global debugfd
puts $debugfd "$name >> $command"
View gist:189557
plugins/README.txt
plugins/JRuby/imagej.rb
plugins/Macros/Bulls_Eye.txt
plugins/Macros/About_Plugin_Macros.txt
plugins/Macros/batch_convert_any_to_tif.txt
plugins/Macros/RGB_Histogram.txt
plugins/Macros/Polygon_.txt
plugins/Utilities/Close_All_Without_Saving.txt
plugins/Examples/Blobs_Demo_in_Ruby.rb
plugins/Examples/Anaglyph_for_Red_Cyan_glasses.rb
View gist:201488
$ PATH=$(pwd):$PATH git fetch localhg
Getting /home/schindelin/git/test-hg
*** failed to import extension hgext.hbisect: No module named hbisect
*** failed to import extension git from /home/schindelin/hg-git: cannot import name weakref
How can I help u todayz on ['localhg', 'hg+/home/schindelin/git/test-hg']?
Got command 'capabilities' with args ''
Capabilities are AWESUM.
Got command 'list' with args ''
View gist:243555
from ij.plugin import Duplicator
from ij3d import *
from java.awt import Font, Frame, Color
from javax.media.j3d import Transform3D
from voltex.Mask import BlendMethod, BlendSource
image = IJ.openImage("/home/iarganda/Desktop/Main_Page_files/Stitching-overview.jpg")
mirror = Duplicator().run(image, 1, image.getStackSize())
View gist:247395
Finding which commits last touched the files
If you _need_ to know which commit gave what file its current form, this script will help you:
(_please_, if you try to be helpful and edit the script, make _at least_ sure that it _still runs_ (that is particularly true if you insist on adding "use strict". Yikes, I thought this goes without saying!)
my %attributions = ();
my @files = ();
View gist:398658
Non generic AB: l=6677230168510043648, t=1764
Generic AB: l=6677230168510043648, t=1739
Generic A+B: l=6677230168510043648, t=1750
Final ABClass: l=6677230168510043648, t=1760
Final APlusBClass: l=6677230168510043648, t=1743
Inline: l=6677230168510043648, t=1975
Non generic AB: l=6677230168510043648, t=2568
Generic AB: l=6677230168510043648, t=2585
Generic A+B: l=6677230168510043648, t=2627
View gist:508521
<source lang="lisp">
(import '(ij IJ))
(def gold (IJ/openImage "http://rsb.info.nih.gov/ij/images/AuPbSn40.jpg"))
(.show gold)
</source>
You can’t perform that action at this time.