Skip to content

Instantly share code, notes, and snippets.

View theothermattm's full-sized avatar

Matt M. theothermattm

View GitHub Profile
@theothermattm
theothermattm / node-stream-transform.js
Created January 30, 2014 12:42
Simple node.js app that transforms a pages content using streams. Uses npm request and npm express. http://localhost:3000/replace?url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions&match=Regular
var express = require('express');
var app = express();
app.get('/replace', function(req, res) {
var request = require('request');
var stream = require('stream');
var zlib = require('zlib');
var url = req.query.url;
@theothermattm
theothermattm / gist:8707598
Created January 30, 2014 12:43
Command line to change the git:// protocol to https:// for those behind a corporate firewall
git config --global url."https://".insteadOf git://
@theothermattm
theothermattm / gist:8740850
Last active August 29, 2015 13:55
Find out current octal permissions of a file for chmod-ing
# linux
stat -c %a FILE
# OS X
stat -f "%OLp" FILENAME
@theothermattm
theothermattm / gist:8743170
Created January 31, 2014 21:08
Get Oracle database name in a sql scrip
select sys_context('userenv','db_name') from dual;
@theothermattm
theothermattm / gist:8793406
Created February 3, 2014 22:06
List java home directories on OS X
/usr/libexec/java_home -V
@theothermattm
theothermattm / gist:8827142
Created February 5, 2014 16:13
Recursively delete .svn folders
find . -name .svn | xargs rm -rf
@theothermattm
theothermattm / gist:8863331
Created February 7, 2014 14:14
Effective SublimeText Vintage Configuration
// in default settings
{
// make sure this happens so vintage mode is enabled
"ignored_packages": []
}
// in user settings
{
// start in command mode instead of edit mode
"vintage_start_in_command_mode": true,
@theothermattm
theothermattm / .vimrc
Last active August 29, 2015 13:56
My .vimrc file
" A lot of this comes from
" https://github.com/thoughtbot/dotfiles/blob/master/vimrc
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
"filetype off
filetype plugin indent on
@theothermattm
theothermattm / private.xml
Created March 17, 2014 15:44
Karibiner (aka KeyRemap4MacBook) mapping file
<?xml version="1.0"?>
<!-- key modifier file for https://pqrs.org/macosx/keyremap4macbook/ -->
<root>
<appdef>
<appname>MacVim</appname>
<equal>org.vim.MacVim</equal>
</appdef>
<appdef>
<appname>Iterm2</appname>
@theothermattm
theothermattm / macsetup.md
Last active August 29, 2015 13:57
Personal Mac Setup Steps