Skip to content

Instantly share code, notes, and snippets.

@fgarcia
fgarcia / pythonbrew_dep.sh
Created August 17, 2012 20:17 — forked from cristianrasch/pythonbrew_dep.sh
pythonbrew dev dependencies on Debian Squeeze
aptitude install build-essential make
aptitude install tk-dev tix-dev libsqlite3-dev
@fgarcia
fgarcia / gist:3728102
Created September 15, 2012 14:05
css box-sizing
<html>
<body>
<div style="background-color:red">
Hello world
<div style="background-color:blue;border:10px solid green;width:100%;box-sizing: border-box">
Sub text
</div>
</div>
</body>
</html>
@fgarcia
fgarcia / gist:3754683
Created September 20, 2012 08:33
Xcode default
defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions -dict ORGANIZATIONNAME "My Company Name GmbH"
@fgarcia
fgarcia / gist:3787218
Created September 26, 2012 10:23
check if url is valid
#!/bin/sh
wget http://www.yahoo.com/ >/dev/null 2>&1
if [[ $? == 0 ]]; then
echo "found it."
fi
@fgarcia
fgarcia / gist:3787239
Created September 26, 2012 10:30
check if remote ssh server is running
status=$(ssh -o BatchMode=yes -o ConnectTimeout=5 $ip echo ok 2>&1)
if [[ $status == ok ]] ; then
echo $ip $host >> good
elif [[ $status == "Permission denied"* ]] ; then
echo $ip $host $status >> no_auth
else
echo $ip $host $status >> other
fi
@fgarcia
fgarcia / gist:3798579
Created September 28, 2012 08:10
reset list of applications for "open with"
sudo /System/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
@fgarcia
fgarcia / gist:3798946
Created September 28, 2012 09:56
Center block and do not wrap text around (sass)
@media only screen and (max-width: 450px)
.centerblock-when-small
float: none !important
margin-left: auto !important
margin-right: auto !important
text-align: center
display: table
@fgarcia
fgarcia / gist:3853194
Created October 8, 2012 15:45
Import tasks from Things to OmniFocus
tell application "Things"
-- Loop through ToDos in Things
repeat with aToDo in to dos of list "Next"
-- Get title and notes of Things task
set theTitle to name of aToDo
set theNote to notes of aToDo
-- Get project name
@fgarcia
fgarcia / gist:3883751
Created October 13, 2012 07:59
launch Skitch and take Crosshair screenshot
activate application "Skitch"
tell application "System Events"
keystroke "5" using {command down, shift down}
end tell
@fgarcia
fgarcia / gist:3883755
Created October 13, 2012 08:03
take screenshot of current Chrome URL
tell application "Google Chrome"
set activeURL to URL of active tab of first window
end tell
activate application "Skitch"
tell application "System Events"
tell application process "Skitch"
click menu item "Snap from Link..." of menu "Capture" of menu bar 1
tell (1st process whose frontmost is true) to keystroke activeURL
keystroke return