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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"/> | |
<style type="text/css"> | |
.page-container { width: 90%; margin: 10px auto; border: 1px solid gray; } | |
.menu { float: left; width: 160px; margin: 0; padding: 10px; border: 1px solid red; } | |
.small { margin-left: 200px; border: 1px solid green; } | |
.wide { margin-left: 0px; width: 100%; border: 1px solid blue; clear: both;} | |
</style> |
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 numberwidth=5 | |
" Supplement to .vimrc | |
let s:running_windows = has("win16") || has("win32") || has("win64") | |
if has("gui_macvim") | |
" Enable shortcuts using the Alt/Option/Meta key on the Mac | |
set macmeta | |
endif | |
" gVim does well in paste mode |
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
var d = @"Col1,Col2,Col3,Col4 | |
Foo,100,""Foo,Bar"",""Foo | |
Bar | |
Baz"" | |
Bar,101,,Quux"; | |
var rx = new Regex("((?<=^|,)(?<field>)(?=,|$)|(?<field>[^\",\\r\\n]+)|\"(?<field>([^\"]|\"\")*)\")(,|(?<rowbreak>\\r\\n|\\n|$))", RegexOptions.Multiline); | |
var matches = rx.Matches(d); | |
matches[6].Groups["field"].Dump(); | |
matches.Dump(); |
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
# alias d="dcat" | |
# d ~/Documents/ | |
# d .gitignore | |
# | |
function dcat() { | |
local path=${1:-.} | |
if [[ -d "$path" ]] ; then | |
ls -al "$path" | |
elif [[ -f "$path" ]] ; then |
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
# Usage: (execute in the .git/objects folder) | |
# recover.ps1 -startDate "8/13/2014 1:22:00pm" -endDate "8/13/2014 8:00:00pm" > borked_files.txt | |
[CmdletBinding()] | |
Param( | |
[string]$startDate, | |
[string]$endDate | |
) | |
$start = [datetime]::Today | |
if ($startDate) { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Drawanagram</title> | |
<!-- iPhone --> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<meta name="apple-touch-fullscreen" content="yes" /> | |
<!-- /iPhone --> |
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
from __future__ import print_function | |
import re | |
import sys | |
# 1. brew cleanup > /tmp/brew_cleanup.txt | |
# 2. python cleanup_total.py /tmp/brew_cleanup.txt | |
cleanup_file = '/tmp/brew_cleanup.txt' | |
if len(sys.argv) > 1: | |
file = sys.argv[1] |
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
d = document; | |
function p(n){return n.parentNode} | |
function $(x){return d.getElementById(x)} | |
function $t(x){return d.getElementsByTagName(x)} | |
function $c(x){return d.getElementsByClassName(x)} | |
function $r(n){p(n).removeChild(n)} | |
if (d.location.href.indexOf('mobile.books24x7') != -1 ) { | |
while($t('link').length != 1) { | |
l = $t('link'); | |
for(var i = 0; i < l.length; i++) if (l[i].href.indexOf('grison') == -1) $r(l[i]); |
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
# npm update -g -ddd | |
npm info it worked if it ends with ok | |
npm verb cli [ 'node', | |
npm verb cli '/usr/local/bin/npm', | |
npm verb cli 'update', | |
npm verb cli '-g', | |
npm verb cli '-ddd' ] | |
npm info using npm@1.0.27 | |
npm info using node@v0.5.5 | |
npm verb /usr/local/bin/node node symlink |
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
#!/bin/bash | |
# filename: transmission_cli_manager.sh | |
# author: Dan Merschi | |
# date: 2009-01-17 (0.69 rev.4260) | |
# update: 2009-03-01 (0.69 rev 4403) | |
# purpose: A fast and easy solution(script) to manage Transmission daemon via transmission-remote client | |
# source: http://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=12&t=822 | |
# | |
if [ -z "$(pgrep transmission-daemon)" ] ;then echo Transmission not running, abort.; exit 3; fi | |
eval $( ps axww | \ |
OlderNewer