Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ljepson
ljepson / ln.sh
Created August 5, 2012 22:20
Create symlinks for my dotfiles
#!/bin/bash
ln -s ~/git/dotfiles/bash_profile ~/.bash_profile;
ln -s ~/git/dotfiles/bashrc ~/.bashrc;
ln -s ~/git/dotfiles/inputrc ~/.inputrc;
ln -s ~/git/dotfiles/screenrc ~/.screenrc;
ln -s ~/git/dotfiles/vimrc ~/.vimrc;
ln -s ~/git/dotfiles/zshrc ~/.zshrc;
@ljepson
ljepson / fast_search.js
Last active October 6, 2015 21:48
Find any element Javascript
// Put in the element you want to find.
var el = document.getElementsByTagName("a"),
// Enter your search term
st = 'whatever',
// Results will go here when done
res;
for(var i = 0; i < el.length; i++) {
// Checking to see if the returned element's innerText matches the search term
if(el[i].innerText === st) {
// Results have been saved if anything was found. You can now use the variable res to do whatever you'd like
@ljepson
ljepson / gvoice.old.js
Created July 6, 2012 05:48
Automate clicking "Select All" checkbox in Google Voice
setInterval(function() { if(!$jq('.jfk-checkbox-checkmark').parent().hasClass('jfk-checkbox-checked') && $jq('#gc-message-list .gc-message').html().length > 1) { $jq('.jfk-checkbox-checkmark').click(); } },1000);
@ljepson
ljepson / html_no_quotes.vim
Created July 5, 2012 15:58
Vim search and replace example=test to example="test"
:%s/\(\w\+=\)\([a-zA-Z0-9\#-_]\+\)/\1"\2"/egci
@ljepson
ljepson / html_single_quotes.vim
Created July 5, 2012 15:57
Vim search and replace example='test' to example="test"
:%s/\(\w\+=\)\('\)\([a-zA-Z0-9\#-_]\+\)\('\)/\1"\3"/egci
@ljepson
ljepson / git.sh
Created July 4, 2012 06:11
Create links for all files stored in git to your local dot files. You can now keep backups on git with ease.
#!/bin/bash
mkdir -p $HOME/git/dotfiles/vim;
files=("bash_profile bashrc inputrc screenrc vim vimrc zshrc");
for file in $files; do
if [[ -h $HOME/.$file ]]; then
unlink $HOME/"."$file;
elif [[ -e $HOME/.$file ]]; then