Skip to content

Instantly share code, notes, and snippets.

View kyleridolfo's full-sized avatar

Kyle Ridolfo kyleridolfo

View GitHub Profile
tell application "Finder" to set theObjects to selection
set nameForNewFolder to "Gathered"
tell application "Finder"
set myOrFilesContainer to (container of item 1 of theObjects) as alias
try
make new folder at myOrFilesContainer with properties {name:nameForNewFolder}
set myContainer to (folder nameForNewFolder of myOrFilesContainer) as alias
@kyleridolfo
kyleridolfo / gist:1014990
Created June 8, 2011 18:20 — forked from croby/gist:1014986
add to your bash .profile
# hide and show finder desktop
alias hidedesktop='defaults write com.apple.finder CreateDesktop -bool false && killall Finder'
alias showdesktop='defaults write com.apple.finder CreateDesktop -bool true && killall Finder'
@kyleridolfo
kyleridolfo / gist:1242286
Created September 26, 2011 13:56
Launch Google Chrome on OS X with a different User-Agent
open ~/Applications/Google\ Chrome.app/ --args -user-agent="MobileSafari 1.1.3 - iPhone --- Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3"
Error: You have uncommitted modifications to Homebrew's core.
Unless you know what you are doing, you should run:
cd /usr/local && git reset --hard
So I run that, but it doesn't reset. Here's what the git status looks like for /usr/local afterwards:
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
@kyleridolfo
kyleridolfo / gist:776d85e6328f13a8b72a
Created September 25, 2014 14:34
Password protect a URI
SetEnvIf Request_URI "/page-to-protect" passreq
AuthType Basic
AuthName "Password Required"
AuthUserFile /path/to/.htpasswd
Require valid-user
Order allow,deny
Allow from all
Deny from env=passreq
Satisfy any
@kyleridolfo
kyleridolfo / uri.js
Last active August 29, 2015 14:18 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@kyleridolfo
kyleridolfo / gist:845c59859e91a0620131
Created April 29, 2015 17:33
Random background colors
// assigns random background color to help with layout.
$(".target").each(function() {
var hue = 'rgb(' + (Math.floor((256-199)*Math.random()) + 200) + ',' + (Math.floor((256-199)*Math.random()) + 200) + ',' + (Math.floor((256-199)*Math.random()) + 200) + ')';
$(this).css("background-color", hue);
});
@kyleridolfo
kyleridolfo / gist:b20e0bc144c4d9fd5b93
Created May 2, 2015 18:25
Parse list of filenames to move files
#/bin/bash
for F in $(cat ./filelist.txt) ; do
mv $F ./uploaded/
done;
@kyleridolfo
kyleridolfo / .bash_profile
Created June 16, 2015 19:25
Open shortcut for bash
function o() {
currentDir='.'
open ${1-$currentDir}
}
$(function() {
});