This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Assuming module foo with method bar: | |
import foo | |
methodToCall = getattr(foo, 'bar') | |
result = methodToCall() | |
#As far as that goes, lines 2 and 3 can be compressed to: | |
result = getattr(foo, 'bar')() | |
#https://stackoverflow.com/questions/3061/calling-a-function-of-a-module-from-a-string-with-the-functions-name-in-python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def textile_to_markdown(textile) | |
d = [] | |
pre = false | |
table_header = false | |
text_line = false | |
textile.each_line do |s| | |
s.chomp! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
altscreen on | |
term screen-256color | |
bind ',' prev | |
bind '.' next | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}%-Lw%{= kW}%50> %n%f* %t%{= kG}%+Lw%< %{= kG}%-=%c:%s%{-}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.tmuxinator/general.yml | |
name: general | |
root: ~/ | |
# Optional tmux socket | |
# socket_name: foo | |
# Runs before everything. Use it to start daemons etc. | |
# pre: sudo /etc/rc.d/mysqld start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- get screen resolution | |
-- Finder method does not work with 10.11 | |
set screenWidth to (do shell script "system_profiler SPDisplaysDataType | awk '/Resolution/{print $2}'") | |
set screenHeight to (do shell script "system_profiler SPDisplaysDataType | awk '/Resolution/{print $4}'") | |
-- Kill old iTerm2 | |
-- added exit 0 to by pass error code when process did not exist. | |
do shell script "killall -9 iTerm2; exit 0" | |
-- get dock size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set-option -g prefix C-a | |
unbind-key C-b | |
bind-key C-a send-prefix | |
# status bar | |
set-option -g status-utf8 on | |
set -g set-titles on | |
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf | |
set-option -g status-bg colour235 #base02 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rdr pass on en0 inet proto tcp to any port 80 -> 127.0.0.1 port 8080 | |
rdr pass on en0 inet proto tcp to any port 443 -> 127.0.0.1 port 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scrub-anchor "com.apple/*" | |
nat-anchor "com.apple/*" | |
rdr-anchor "com.apple/*" | |
rdr-anchor "forwarding" | |
dummynet-anchor "com.apple/*" | |
anchor "com.apple/*" | |
load anchor "com.apple" from "/etc/pf.anchors/com.apple" | |
load anchor "forwarding" from "/etc/pf.anchors/mitm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// LDAP variables | |
$ldaphost = ""; // your ldap servers | |
$ldapport = 389; // your ldap server's port number | |
// Connecting to LDAP | |
$ldapconn = ldap_connect($ldaphost, $ldapport) | |
or die("Could not connect to $ldaphost"); | |
ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3); | |
if ($ldapconn) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tun-mtu 6000 | |
fragment 0 | |
mssfix 0 | |
cipher aes-256-cbc |