Skip to content

Instantly share code, notes, and snippets.

View dalemanthei's full-sized avatar

Dale Manthei dalemanthei

  • Great White North, eh.
View GitHub Profile
@dalemanthei
dalemanthei / EsFormatter.sublime-settings
Created December 6, 2014 14:28
sprint-web esformat configuration
{
"format_options" : {
"indent": {
"value": "\t",
"MultipleVariableDeclaration": 1,
},
"whiteSpace": {
"after": {
"FunctionReservedWord": 1,
}
@dalemanthei
dalemanthei / Evernote.sublime-settings
Created November 30, 2014 17:56
sublime-evernote css styles for github like styling
"inline_css": {
"pre": "color: #000000; font-family: monospace,monospace; font-size: 0.9em; white-space: pre-wrap; word-wrap: break-word; background-color: #f8f8f8; border: 1px solid #cccccc; border-radius: 3px; overflow: auto; padding: 6px 10px; margin-bottom: 10px;",
"code": "color: black; font-family: monospace,monospace; font-size: 0.9em;",
"h1": "margin: 20px 0 10px; padding: 0; font-weight: bold; -webkit-font-smoothing: antialiased; cursor: text; position: relative;",
"h2": "margin: 20px 0 10px; padding: 0; font-weight: bold; -webkit-font-smoothing: antialiased; cursor: text; position: relative;",
"h3": "margin: 20px 0 10px; padding: 0; font-weight: bold; -webkit-font-smoothing: antialiased; cursor: text; position: relative;",
"h4": "margin: 20px 0 10px; padding: 0; font-weight: bold; -webkit-font-smoothing: antialiased; cursor: text; position: relative;",
"h5": "margin: 20px 0 10px; padding: 0; font-weight: bold; -webkit-font-smoothing: antialiased; cursor: text; position: relative;",
// load all grunt tasks "Just In Time"
require('jit-grunt')(grunt, {
ngconstant: 'grunt-ng-constant'
});
@dalemanthei
dalemanthei / provide-$log.js
Last active January 24, 2016 22:43
Enable $log for production AngularJS running in Jasmine
beforeEach(module('myApp', function($provide) {
$provide.value('$log', console);
}));
@dalemanthei
dalemanthei / isArray
Created November 3, 2014 14:48
Check if JavaScript variable is an array
// http://stackoverflow.com/questions/4775722/check-if-object-is-array
if( Object.prototype.toString.call( someVar ) === '[object Array]' ) {
alert( 'Array!' );
}
@dalemanthei
dalemanthei / lsn
Created October 17, 2014 15:12
lsn to list node modules, use -g for global installed list, put this in your ~/.bash_profile
lsn() {
npm list $1 --depth=0
}
@dalemanthei
dalemanthei / install-osx.rb
Last active August 29, 2015 14:06
Ruby script to install OS X apps on system
#!/usr/bin/ruby
# todo: add prompt for installing app store apps first
# todo: hook in homebrew installation
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brews = [
'ant',
'brew-cask',
@dalemanthei
dalemanthei / getPathFinderSelections
Created June 30, 2014 16:31
A little bit of AppleScript to get a list of selected files from Path Finder.
tell application "Path Finder"
set theSelection to selection
set selection_list to theSelection as list -- list of fsItems (fsFiles and fsFolders)
set LF to character id 10
set AppleScript's text item delimiters to LF
if theSelection is not missing value then
set fileList to {}
repeat with aFile in selection_list
set end of fileList to POSIX path of aFile
end repeat
@dalemanthei
dalemanthei / Preferences.sublime-settings
Created January 12, 2014 03:54
Preferences.sublime-settings
{
"close_windows_when_empty": false,
"color_scheme": "Packages/User/Monokai Extended (SL).tmTheme",
"font_face": "consolas",
"font_size": 15,
"ignored_packages":
[
"Vintage",
"Markdown"
],
@dalemanthei
dalemanthei / Jump to Finder or Path Finder
Created December 29, 2013 19:33
A .bash_profile snippet for Mac OS X from http://brettterpstra.com/2013/02/09/quick-tip-jumping-to-the-finder-location-in-terminal/ with added snippet for Path Finder.
# from http://brettterpstra.com/2013/02/09/quick-tip-jumping-to-the-finder-location-in-terminal/
# cd to the path of the front Finder window
cdf() {
target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'`
if [ "$target" != "" ]; then
cd "$target"; pwd
else
echo 'No Finder window found' >&2
fi
}