Skip to content

Instantly share code, notes, and snippets.

Avatar

Leonhard Melzer leomelzer

View GitHub Profile
View gist:141343
// http://tore.darell.no/posts/buttons_what_buttons
// prototypejs
/*
document.observe('dom:loaded', function(){
$$('form.button-to').each(function(form){
var link = new Element('a', {href:'#', 'class':'button-to'});
link.update(form.down('input[type=submit]').value);
link.observe('click', function(e){
e.stop();
form.submit();
@leomelzer
leomelzer / product-measure-bookmarklet.js
Created Aug 2, 2009
ever wondered how big this product you are looking at right now in some online-shop really is? try this bookmarklet!
View product-measure-bookmarklet.js
javascript:(function(raw)%20{var%20units%20=%20[%27mm%27,%20%27cm%27,%20%27in%27,%20%27inch%27];var%20unit%20=%20%27mm%27;for%20(var%20i%20=%200;%20i%20<%20units.length;%20i++)%20{if%20(raw.indexOf(units[i])%20!=%20-1)%20{if%20(units[i]%20==%20%27inch%27)%20{unit%20=%20%27in%27;}else%20{unit%20=%20units[i];}}}if%20(raw.indexOf(%22n%22)%20!=%20-1)%20{var%20parts%20=%20raw.split(%22n%22);}else%20{var%20parts%20=%20raw.split(%27x%27);}if%20(parts.length%20<=%201)%20{alert(%27No%20valid%20data%20found%20in%20text-selection...%27);return%20false;}var%20cleaned%20=%20[];var%20clean_index%20=%200;for%20(var%20i%20=%200;%20i%20<%20parts.length;%20i++)%20{parts[i]%20=%20parts[i].replace(/,/g,%20%27.%27);parts[i]%20=%20parts[i].replace(/[a-z%C3%A4%C3%B6%C3%BC%C3%84%C3%96%C3%9C:]/gi,%20%27%27);parts[i]%20=%20parts[i].replace(/\(.*\)/g,%20%27%27);parts[i]%20=%20parts[i].replace(/s+/,%20%27%27);if%20(parts[i]%20!=%20%27%27)%20{cleaned[clean_index++]%20=%20parts[i].trim();}}parts%20=%20cleaned;var%20model%20=%20document.cr
View replace @ and . in given string for pseudo-spam-protection
// please refactor me. this is *so* ugly.
var foo = /\b([A-Z0-9._%-]+)@([A-Z0-9.-]+)\.([A-Z]{2,4})\b/gi;
var text = '<p>E-Mail:&nbsp;<a href="mailto:info@foobar.net">info@foobar.net</a></p><p>Anfragen bitte an: <a href="mailto:anfrage@foobar.net">anfrage@foobar.net</a>.</p>';
var temp;
var result = [];
while( temp = foo.exec(text) ) {
result.push({
alt : temp[0],
neu : temp[1] + '&#64;' + temp[2] + '&#46;' + temp[3]
View OS X Software.md

####This is more than expected, for reference.#

  • 1Password
  • Adium
  • Alfred
  • AppCleaner
  • AppFresh
  • BetterTouchTool
  • Caffeine
  • Chax
View keybase.md

Keybase proof

I hereby claim:

  • I am leomelzer on github.
  • I am leomelzer (https://keybase.io/leomelzer) on keybase.
  • I have a public key whose fingerprint is B830 BC00 A09B EA9E 22D1 BA1F 6CA2 10A5 16B7 7B28

To claim this, I am signing this object:

@leomelzer
leomelzer / T-Shirt Slogans.md
Created May 1, 2011
Slogans I'd like to print on T-Shirts. So, someday...
View T-Shirt Slogans.md
  1. "It takes some Silence to make Sound."
  2. "We reject kings, presidents and voting. We believe in rough consensus and running code." – Dave Clark (IETF T-shirt, 1992)
  3. "Good luck exploring the infinite abyss." – Garden State
  4. "Als wir jung waren ist jetzt."
  5. "I post quality content to Facebook."
  6. Walking routes in Cities Viz: http://www.flickr.com/photos/walkingsf/4621770959/in/set-72157623971287575/
  7. Lisbon Traffic Viz: http://www.flickr.com/photos/pmcruz/4449045508/
  8. "Attitude. Awareness. Authenticity." http://www.ted.com/talks/neil_pasricha_the_3_a_s_of_awesome.html
  9. "Just add some Curry."
@leomelzer
leomelzer / gist:1144268
Created Aug 13, 2011
Should you ever have to create an audio file (in stereo) which counts from zero to 999, this might come in handy.
View gist:1144268
$ say --channels=2 -o foo " 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 27
@leomelzer
leomelzer / Wallpapers.md
Created Aug 18, 2011
My Wallpaper Collection, used with the randomized-rotate in OS X. Note: All rights belong to the corresponding owners of the imagery. If you don't like your work shown here, please drop me a line and I'll remove it from the list.
@leomelzer
leomelzer / gist:3192524
Created Jul 28, 2012
Skype Spam - the best
View gist:3192524

Hello Hewitt

I am sorry to contact you unannounced through this medium. My name is Mr. Jayden Mensah, Deputy General Manager-Audit & Compliance at Barclays Bank Ltd Ghana. I write you this proposal in good faith hoping that I will rely on you. In 2006, one Mr. Daniel Hewitt who has same surname as yours and your country in his file as his country of origin, made a fixed deposit for 36 calendar months, valued at $8,400,000.00 with my bank. I was his account officer before I rose to the position of the auditor general now. The maturity date for this deposit contract was 16th of January 2009. Unfortunately, while he was on a business trip, he died leaving the funds unclaimed in my bank without any beneficiary in a deadly earthquake that occurred on May 12, 2008 in Sichuan province of China which killed at least 68,000 people, wish he was among the victim.

I need your cooperation so as to make my bank send you the fund as the beneficiary and next of kin to the fund. This transaction will be of a great mutual as

@leomelzer
leomelzer / tmux_local_install.sh
Last active Nov 24, 2015 — forked from sharjeelsayed/tmux_local_install.sh
bash script for installing tmux without root access.Updated to include latest Tmux version and some other minor changes
View tmux_local_install.sh
#!/bin/bash
# Source: https://gist.github.com/ryin/3106801
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=2.1