Skip to content

Instantly share code, notes, and snippets.

View padde's full-sized avatar

Patrick Oscity padde

View GitHub Profile
require 'continuation'
$__labels__ = {}
def label(label)
callcc {|cc| $__labels__[label] = cc }
end
def goto(label)
$__labels__[label].call
@padde
padde / 5F9D1786.asc.txt
Last active August 29, 2015 14:00
My PGP Public Key (7B8E 3327 8E52 E3E1 8392 92AE CCBB 382F 5F9D 1786)
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - https://gpgtools.org
mQINBFKjG38BEAC7ahP+UblWBW4MqOwjcFy2KdOS+dBkf77KNUCL4K+uFrmr0g8y
ux1eiTBvNVQ93p4DQIZJulfAS8AlSBHknVcA7RWLEvPt37g6yA2ppWW26ybEM4B/
ixXYMSNVGWKVJP6ce21GBGX/DtNWcjB7B3VB0y3qN1J+hoDOtd9ODoL2Hcl5tlMJ
G3hGK4IbPGIWTIN2YzV/ABondVIvcpn2GkKjcpFivuDubimb75QiwW9C3vF4NMjE
73lUm7ongQkZaBrevgGUXIt/LnEI/Dd7NPWrYDYE4HWa3hlfIHUiDNhr9dnsGT2d
6cuZY3LqRFBx707KQiW9Hv35R1rL5bkHsl8LiS7W/7TZdgNkyKZfBvcQmYSlW8D+
@padde
padde / inject_jquery.js
Last active August 29, 2015 13:56
Inject jQuery Bookmarklet
(function(){
var s = document.createElement('script');
s.setAttribute('src', 'https://code.jquery.com/jquery-latest.min.js');
if (typeof jQuery == 'undefined') {
document.getElementsByTagName('head')[0].appendChild(s);
}
})();
@padde
padde / load_path_symlink.rb
Last active August 29, 2015 13:56
Adding lib directory to load path, even when called as a symlink
# MathN using Ruby 2.0 refinements instead of plain monkey patches
# Patrick OSCITY 2013
#
# Based on original mathn implementation by Keiju ISHITSUKA from Ruby 1.8.7-p72
# http://www.opensource.apple.com/source/ruby/ruby-75/ruby/lib/mathn.rb
#
# Distributes under the same terms as Ruby.
require "complex"
require "rational"
@padde
padde / zsh.rb
Created December 14, 2013 18:46
require 'formula'
class Zsh < Formula
homepage 'http://www.zsh.org/'
url 'http://www.zsh.org/pub/zsh-5.0.2.tar.bz2'
mirror 'http://downloads.sourceforge.net/project/zsh/zsh/5.0.2/zsh-5.0.2.tar.bz2'
sha1 '9f55ecaaae7cdc1495f91237ba2ec087777a4ad9'
depends_on 'gdbm'
depends_on 'pcre'
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 17b78ce..f136178 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -1576,7 +1576,7 @@ zrefresh(void)
else
put_rpmpt = rprompth == 1 && rpromptbuf[0] &&
!strchr(rpromptbuf, '\t') &&
- (int)ZR_strlen(nbuf[0]) + rpromptw < winw - 1;
+ (int)ZR_strlen(nbuf[0]) + rpromptw < winw;
@padde
padde / quine.rb
Last active December 20, 2015 07:49
A little Quine
puts a=[<<-X*2,?X]
puts a=[<<-X*2,?X]
X
@padde
padde / openvpn.md
Last active June 6, 2025 21:03
OpenVPN on Ubuntu 12.10 at DigitalOcean

OpenVPN on Ubuntu 12.10 at DigitalOcean

Install OpenVPN

sudo apt-get install openvpn

Generate Server Certificates

sudo cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0 /etc/openvpn/easy-rsa2

cd /etc/openvpn/easy-rsa2

<wsdl:definitions xmlns:ns2="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Magento" targetNamespace="urn:Magento">
<wsdl:types>
<xs:schema targetNamespace="urn:Magento">
<xs:attribute name="root">
<xs:annotation>
<xs:documentation>
'root' can be used to distinguish serialization roots from other
elements that are present in a serialization but are not roots of
a serialized value graph
</xs:documentation>