Skip to content

Instantly share code, notes, and snippets.

View MikeRalphson's full-sized avatar
💭
I may be slow to respond.

Mike Ralphson MikeRalphson

💭
I may be slow to respond.
View GitHub Profile
@MikeRalphson
MikeRalphson / partial git.git Makefile fix
Created March 17, 2009 14:52
partial git.git Makefile fix, needs to regenerate GIT_BUILD_OPTIONS only when it changes
diff --git a/Makefile b/Makefile
index 2b873fa..159b8be 100644
--- a/Makefile
+++ b/Makefile
@@ -1159,7 +1159,7 @@ common-cmds.h: ./generate-cmdlist.sh command-list.txt
common-cmds.h: $(wildcard Documentation/git-*.txt)
$(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@
-$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
+$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh GIT-BUILD-OPTIONS
@MikeRalphson
MikeRalphson / gist:80650
Created March 17, 2009 17:01
Partial patch to 'git diff as a better diff' to cope with common d/f case
diff --git a/diff-no-index.c b/diff-no-index.c
index 598687b..6546975 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -54,11 +54,34 @@ static int get_mode(const char *path, int *mode)
static int queue_diff(struct diff_options *o,
const char *name1, const char *name2)
{
- int mode1 = 0, mode2 = 0;
+ int mode1 = 0, mode2 = 0, mode3 = 0;
@MikeRalphson
MikeRalphson / deltawarn.pl
Created March 25, 2009 16:13
Softshare Delta Warning in Perl
use strict;
use warnings;
use OLE; # OLE.pm module
# Make OLE connection: this creates an instance of an Delta object
my $delta = CreateObject OLE 'Delta.Executor.1' || die $!;
my $args = "";
my $c = 0;
@MikeRalphson
MikeRalphson / gist:96934
Created April 17, 2009 09:07
pfxstate.inc xml version
#IFDEF show_includes
#REM pfxstate.inc
#ENDIF
#USE stringf.pfi
#USE lparse.inc
STRING S_PFX_STATE 1 // C=CODE, I=IMAGE
STRING S_PFX_CODE 4096 S_PFX_COMMENT 256 S_PFX_IMAGE 256
string s_inc_stack 4096
<?xml version='1.0'?>
<pfxplus>
<directive type="ifdef"><token value="show_includes"/></directive>
<stmt type="symbol" value="#rem"><token value="pfxstate.inc"/></stmt>
<directive type="endif"></directive>
<directive type="use"><token value="stringf.pfi"/></directive>
<directive type="use"><token value="lparse.inc"/></directive>
<declare type="string"><token value="s_pfx_state"/><number value="1"/><!-- C=CODE, I=IMAGE --></declare>
<declare type="string"><token value="s_pfx_code"/><number value="4096"/><token value="s_pfx_comment"/><number value="256"/><token value="s_pfx_image"/><number value="256"/></declare>
<declare type="string"><token value="s_inc_stack"/><number value="4096"/></declare>
<?xml version='1.0'?>
<pfxplus>
<directive type="use"><token value="pfxstate.inc"/></directive>
<declare type="string"><token value="s_filename"/><number value="256"/></declare>
<declare type="string"><token value="s_input"/><number value="4096"/></declare>
<declare type="string"><token value="s_out"/><number value="4096"/></declare>
<declare type="string"><token value="s_our_new"/><number value="4096"/></declare>
<declare type="string"><token value="s_remainder"/><number value="4096"/></declare>
<declare type="integer"><token value="i_loop"/><token value="i_state"/></declare>
<declare type="integer"><token value="i_stack"/></declare>
#!/bin/sh
# $1 should be the input textfile
# $2 should be the output pdf filename
# $3 should be the email address to send to
if [ "$2" = "" ]
then
echo Usage: textfile pdfname email
else
if ($oi->{'type'} eq 'str') {
@projects = sort {$a->{$oi->{'key'}} cmp $b->{$oi->{'key'}}} @projects;
} else {
#@projects = sort {$a->{$oi->{'key'}} <=> $b->{$oi->{'key'}}} @projects;
@projects = sort {!$a->{$oi->{'key'}} ? 1 : !$b->{$oi->{'key'}} ? -1 : $a->{$oi->{'key'}} <=> $b->{$oi->{'key'}}} @projects;
}
Thread currentThread = Thread.CurrentThread;
int threadID = currentThread.GetHashCode();
Trace.WriteLine("Thread ID is "+ threadID);
strHostName = DNS.GetHostName ();
IPHostEntry ipEntry = DNS.GetHostByName (strHostName);
IPAddress[] addr = ipEntry.AddressList[0];
#!/bin/sh
out=`basename $1 .mov`
out=`basename $out .mp4`
out=`basename $out .flv`
ffmpeg -i $1 -vn -acodec copy -y ${out}.m4a