Skip to content

Instantly share code, notes, and snippets.

@jzawodn
jzawodn / wait.sh
Created November 21, 2008 15:13
how to wait on multiple background processes and check exit status in bash
#!/bin/bash
FAIL=0
echo "starting"
./sleeper 2 0 &
./sleeper 2 1 &
./sleeper 3 0 &
./sleeper 2 0 &
@bert
bert / .gitignore
Created December 19, 2009 14:19
GIOChannel based command system example
*.o
*~
command
@bert
bert / pango_layout_word_wrap.c
Created December 23, 2009 05:28
Pango layout word wrap example
/*!
* \file pango_layout_word_wrap.c
* \brief pango layout word wrap
*
* \author Ben Pfaff http://benpfaff.org
*
* In working with Pango I found an oddity that I do not understand.
* It may be a bug, or it might just be my misunderstanding.
*
* As part of a table layout procedure for printing, my code wishes to find out
@katylava
katylava / git-selective-merge.md
Last active February 27, 2024 10:18
git selective merge

Update 2022: git checkout -p <other-branch> is basically a shortcut for all this.

FYI This was written in 2010, though I guess people still find it useful at least as of 2021. I haven't had to do it ever again, so if it goes out of date I probably won't know.

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

@bfoz
bfoz / fixup_committer_date.sh
Created September 7, 2010 19:24
Force GIT_COMMITTER_DATE = GIT_AUTHOR_DATE
git filter-branch --env-filter 'export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"'
/*
* WARNING
* This is just an idea. This code might not actually run. There are no
* tests. It was abandoned before I could finish it.
*/
/*
* AutoQueue
*
* www.github.com/jtwb
@dagolden
dagolden / cpan-local-lib-demo.txt
Created January 5, 2011 11:31
Demo of CPAN.pm with local::lib bootstrap
cleanroom@vulcan:~$ /opt/perl/v5.13.7-clean/bin/cpan
CPAN is the world-wide archive of perl resources. It consists of about
300 sites that all replicate the same contents around the globe. Many
countries have at least one CPAN site already. The resources found on
CPAN are easily accessible with the CPAN.pm module. If you want to use
CPAN.pm, lots of things have to be configured. Fortunately, most of
them can be determined automatically. If you prefer the automatic
configuration, answer 'yes' below.
@stuartpb
stuartpb / example.lua
Last active December 14, 2021 18:11
Lua script for fancy named parameters with default values
local fp = require "fancyparams"
myfunction = fp(
{{"a"},{"b",7},{"c",5}},
function(a, b, c)
print(a, b, c)
end
)
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@dgleich
dgleich / sidenotes-demo.tex
Created June 25, 2011 17:27
tufte sidenotes -- a tufte-latex ripoff
\documentclass{article}
\usepackage{booktabs}
\usepackage{geometry}
\usepackage{tabularx}
\geometry{lmargin=72pt,tmargin=72pt,textwidth=350pt,marginparwidth=144pt}
\usepackage{tufte-sidenotes}
\begin{document}
Here is demo of the \verb#tufte-sidenotes# style.