Skip to content

Instantly share code, notes, and snippets.

if (defined $headrev && $self->use_svm_props) {
if ($self->rewrite_root) {
die "Can't have both 'useSvmProps' and 'rewriteRoot' ",
"options set!\n";
}
if ($self->rewrite_uuid) {
die "Can't have both 'useSvmProps' and 'rewriteUUID' ",
"options set!\n";
}
my ($uuid, $r) = $headrev =~ m{^([a-f\d\-]{30,}):(\d+)$}i;
while (<$log>) {
if (/^${esc_color}commit -?($::sha1_short)/o) {
my $cmt = $1;
if ($c && cmt_showable($c) && $c->{r} != $r_last) {
$r_last = $c->{r};
process_commit($c, $r_min, $r_max, \@k) or
goto out;
}
$d = undef;
$c = { c => $cmt };
@myme
myme / gist:978139
Created May 18, 2011 07:28
UTF8-ify -- Crap
#!/usr/bin/env python
import sys
alpha = {
'a' : u'\u1EA1', 'b' : u'\u1E05', 'c' : u'\u1E09',
'd' : u'\u1E0D', 'e' : u'\u1EB9', 'f' : u'\u1E1F',
'g' : u'\u1E21', 'h' : u'\u1E25', 'i' : u'\u1ECB',
'k' : u'\u1E33', 'l' : u'\u1E37', 'm' : u'\u1E43',
'n' : u'\u1E45', 'o' : u'\u1ECD', 'p' : u'\u1E57',
@myme
myme / gist:978275
Created May 18, 2011 09:24
Transifex 0.7 encoding issues
diff -r 383d275de04c transifex/webtrans/wizards.py
--- a/transifex/webtrans/wizards.py Thu Jul 01 00:43:08 2010 +0000
+++ b/transifex/webtrans/wizards.py Wed May 18 09:21:56 2011 +0000
@@ -404,7 +404,7 @@
filename = self.pofile.filename
if self.po_entries_changed:
- po_contents = self.po_entries.__str__().encode('utf-8')
+ po_contents = self.po_entries.__str__().decode('utf-8').encode('utf-8')
edited_file = SimpleUploadedFile(filename, po_contents)
eplemos :: ~ » gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@myme
myme / di.py
Created September 7, 2012 10:50
DI?
def _import(dep):
print "importing %s" % dep
imported = None
exec "import %s; imported = %s" % (dep, dep)
return imported
def inject(*deps):
def wrapper(fn):
loaded_deps = {}
@myme
myme / toFive.hs
Created November 5, 2012 09:01
Flippety
djent :: ~/try-bin/hs » ./toFive.hs
222
2 2
2
22
22222
--- le mirror ---
55555
el( 'div.main-container', [
el( 'h1', 'Title!' ),
el( 'p', 'Foo, bar, baz' ),
el( 'form', { action: 'foo.cgi' }, [
el( 'input', { placeholder: 'username' } ),
el( 'input', { type: 'password', placeholder: 'password' } )
])
]);
@myme
myme / :options
Last active December 22, 2015 14:49
:version, :scriptnames and :options output. All plugins loaded and while editing / opening a coffee-script buffer.
" Each "set" line shows the current value of an option (on the left).
" Hit <CR> on a "set" line to execute it.
" A boolean option will be toggled.
" For other options you can edit the value.
" Hit <CR> on a help line to open a help window on this option.
" Hit <CR> on an index line to jump there.
" Hit <Space> on a "set" line to refresh it.
1 important
2 moving around, searching and patterns
@myme
myme / bar.hs
Last active December 22, 2015 15:48
fromMaybe :: Maybe a -> String
fromMaybe Nothing = "Nothing"
fromMaybe Just a = show a