Skip to content

Instantly share code, notes, and snippets.

Avatar

Lonny ljepson

  • Utah
View GitHub Profile
@ljepson
ljepson / ln.sh
Created Aug 5, 2012
Create symlinks for my dotfiles
View ln.sh
#!/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 Oct 6, 2015
Find any element Javascript
View fast_search.js
// 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 Jul 6, 2012
Automate clicking "Select All" checkbox in Google Voice
View gvoice.old.js
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 Jul 5, 2012
Vim search and replace example=test to example="test"
View html_no_quotes.vim
:%s/\(\w\+=\)\([a-zA-Z0-9\#-_]\+\)/\1"\2"/egci
@ljepson
ljepson / html_single_quotes.vim
Created Jul 5, 2012
Vim search and replace example='test' to example="test"
View html_single_quotes.vim
:%s/\(\w\+=\)\('\)\([a-zA-Z0-9\#-_]\+\)\('\)/\1"\3"/egci
@ljepson
ljepson / git.sh
Created Jul 4, 2012
Create links for all files stored in git to your local dot files. You can now keep backups on git with ease.
View git.sh
#!/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
You can’t perform that action at this time.