Skip to content

Instantly share code, notes, and snippets.

View benzittlau's full-sized avatar

Ben Zittlau benzittlau

View GitHub Profile
@benzittlau
benzittlau / gist:37163482be834ea995f0
Created September 15, 2014 18:08
Copy file name to clipboard in vim
:let @* = @%
@benzittlau
benzittlau / gist:e628488f7c5e6ee48d61
Created September 13, 2014 19:59
Vim Writing Settings
set formatoptions+=a # auto reformat paragraphs
set formatoptions+=t # enable auto line wraping
set tw=100
@benzittlau
benzittlau / gist:ec60e41ca2197909b57e
Created August 18, 2014 16:20
Authing for shaw open using command line
curl -L -v --data "username=<username>@shaw.ca&password=<password>&acpt=on&language=en" https://wifisignon.shaw.ca/api/login
@benzittlau
benzittlau / gist:6940664
Created October 11, 2013 19:30
Backtrace in PHP
foreach(debug_backtrace() as $trace) {
echo $trace['file'] . "::" . $trace['function'] . "::" . $trace['line'] . "\n";
}
@benzittlau
benzittlau / request.sh
Last active December 16, 2015 09:39 — forked from EricWarnke/request.sh
curl https://api.mover.io/connectors/lOVdV48pmWA7GDmmjkth/collections/DKLsd898sdKj/items \
-X POST \
-H "Authorization: MoverAPI app_id=2tsc0f9n9l4v209oara0mb2j5ur9my8v app_secret=65oow347p1q7d0loj45oje2u3sol99xd" \
-F item=@"my_pic.jpg"
@benzittlau
benzittlau / irbrc.rb
Created March 4, 2013 04:19
Default irbrc in rvm
# This is the common irbrc file used by all rvm ruby installations.
# This file will be overriden every time you update rvm.
# Turn on completion.
begin
require "readline"
require "irb/completion" rescue nil
# Turn on history saving.
@benzittlau
benzittlau / gist:4710231
Created February 4, 2013 22:17
Regex expressions that will never match anything
/(?!x)x/
/a^/
/$a/
<?php
'modifiedDate' => date(DateTime::RFC3339, $timestamp)
@benzittlau
benzittlau / basename_locale.php
Created November 24, 2012 22:31
Test demonstrating the danger of not explicitly setting your locale in PHP
<?php
// Set the locale to 'C'
setlocale(LC_CTYPE, 'C');
// Set the string to 'Test Folder' in hebrew
$path = '/Hebrew Test Folder/מחרוזת בדיקה';
// Echo out just the base string
echo $path . "\n"; // /Hebrew Test Target/מחרוזת בדיקה
@benzittlau
benzittlau / tmux.conf
Created November 9, 2012 03:30
Template tmux.conf file
# Act like Vim
set-window-option -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Look good
set-option -g default-terminal "screen-256color"