Skip to content

Instantly share code, notes, and snippets.

@mrgcohen
mrgcohen / data.json
Last active December 13, 2015 20:18
Javascript Load data into region. Pass in selector to load data to, data object. Will loop through data and place all the data into the locations based on the level and class. So you can easily template info
{
"person":{
"firstname":"Mike",
"lastname":"lovely",
"favs":{
"animal":"cat",
"activity":"cycling"
}
},
"comment":"i'm so tired"
@mrgcohen
mrgcohen / case_insenstive_mac_terminal.sh
Created February 21, 2013 00:40
case insensitive mac terminal - don't hate me
echo "linux users don't hate me but i love it"
echo "set completion-ignore-case On" >> ~/.inputrc
@mrgcohen
mrgcohen / Readme.md
Last active November 9, 2022 22:17
Twitter Bootstrap Typeahead autocomplete example

Requirements

  • bootstrap with typeahead
  • jquery

Explanation

This will use bootstrap with typeahead to create an autocomplete search.

@mrgcohen
mrgcohen / .bash_history
Last active December 15, 2015 14:59
Coldfusion setup mac (FML)
export=$PATH:/Application/ColdFusion10/cfusion/bin
@mrgcohen
mrgcohen / ssh_authorized_keys_setup.md
Last active December 21, 2015 01:28
authorized keys linux...how have i not been doing this more ...also i love ssh-agent

[ Dana = Local Machine ]
[ Michael = remote machine ]

  1. cd into home .ssh directory on Dana
cd ~/.ssh
  1. On Dana Create a keypair and include a passphrase (we can have apple keychain save it and never have to remember it... thanks ssh-agent)

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@mrgcohen
mrgcohen / .emacs.lisp
Created August 19, 2013 18:58
emacs please switch tabs to spaces
;; if indent-tabs-mode is off, untabify before saving
(add-hook 'write-file-hooks
(lambda () (if (not indent-tabs-mode)
(untabify (point-min) (point-max)))
nil ))
@mrgcohen
mrgcohen / current_tab_chrome.js
Created August 20, 2013 01:01
get current tab id chrome
chrome.tabs.query({active:true,windowType:"normal"},function(d){console.debug(d[0].id);})
@mrgcohen
mrgcohen / a_rm_move_to_trash.bash
Created September 19, 2013 20:19
rm = move to trash
if [ $# -eq 0 ]; then
echo "usage: trashit <files...>" >&2
exit 2;
fi
for file in "$@"; do
# get just file name
destfile="`basename \"$file\"`"
suffix='';
i=0;
@mrgcohen
mrgcohen / role.sql
Created March 10, 2014 20:59
add role postgres
create role myapp with createdb login password 'password1'