Skip to content

Instantly share code, notes, and snippets.

/*!
*
* Automatic Responsive screenshots creation with PhantomJS and CasperJS.
* Adapted from the Responsive Design Workflow book by Stephen Hay (http://responsivedesignworkflow.com/).
*
* Usage instructions:
- Install PhantomJS (http://phantomjs.org/) and CasperJS (http://casperjs.org/)
- Save this script as `screenshots-multipages.js` in a folder somewhere in your filesystem
- In the same folder, create a subfolder called `screenshots` (defined in `screenshotFolder` variable)
- Define the URLs you want to process in `baseUrl` (string) and `links` (array) variables
@NicholasModesto
NicholasModesto / snippet-template.sublime-snippet
Created October 7, 2013 16:58
#SublimeText snippet for creating SublimeText snippets.
<snippet>
<content>
<![CDATA[
<!-- Save File as .sublime-snippet -->
<snippet>
<content>
<![CDATA[
<!-- Type your snippet here -->
@NicholasModesto
NicholasModesto / desktop-toggle.sh
Created July 24, 2013 23:12
#Shell script that toggles files on your OSX desktop.
VAL=$(defaults read com.apple.finder CreateDesktop);
if [ $VAL == 0 ]; then
osascript -e 'tell app "System Events" to display dialog "Your desktop has been restored."'
defaults write com.apple.finder CreateDesktop -bool true
killall Finder
else
osascript -e 'tell app "System Events" to display dialog "Now hiding your desktop."'
defaults write com.apple.finder CreateDesktop -bool false
killall Finder
fi
@NicholasModesto
NicholasModesto / hidden-files-toggle.sh
Created July 24, 2013 23:09
#Shell script that toggles hidden files on OSX
VAL=$(defaults read com.apple.finder AppleShowAllFiles);
if [ $VAL == 0 ]; then
defaults write com.apple.finder AppleShowAllFiles -bool TRUE
killall Finder
osascript -e 'tell app "System Events" to display dialog "Now Showing Hidden Files."'
else
defaults write com.apple.finder AppleShowAllFiles -bool FALSE
killall Finder
osascript -e 'tell app "System Events" to display dialog "Hidden Files Now Invisible."'
fi
@NicholasModesto
NicholasModesto / osx-backup.sh
Created July 24, 2013 23:05
#Shell script to backup a directory to a remote directory on a mounted volume and log the changes made.
# MOUNT SERVER
osascript -e 'tell app "Finder" to open location "smb://$USER:$PASS@$SERVER"'
# SLEEP - PROVIDES SYSTEM TIME TO MOUNT THE VOLUME
sleep 5
# DEFINE ACTIVE PROJECT VARIABLES
A_LOG="PATH-TO-A-LOG-DIRECTORY/ACTIVE_SYNC_LOG.txt"
A_SOURCE="SOURCE-DIRECTORY"
A_TARGET="REMOTE-TARGET-DIRECTORY"
@NicholasModesto
NicholasModesto / regex-find-http
Created July 24, 2013 23:01
Regex - Find HTTP string
^(https://www\.|http://www\.|https://|http://)(\S+)
@NicholasModesto
NicholasModesto / html-template.html
Last active October 12, 2015 05:18
#HTML: Template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
@NicholasModesto
NicholasModesto / jquery-document-ready.html
Last active October 12, 2015 05:18
#JS: jQuery Setup
<script type="text/javascript">
$(document).ready(function(){
// Your code here
});
</script>