This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "iTerm" | |
activate | |
#if a terminal exists, use that. if not, create a new one | |
try | |
set _term to current terminal | |
on error | |
set _term to (make new terminal) | |
end try | |
tell _term |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH="$PATH:~/bin" | |
# Set CLICOLOR if you want Ansi Colors in iTerm2 | |
export CLICOLOR=1 | |
# Set colors to match iTerm2 Terminal Colors | |
export TERM=xterm-256color | |
# personal functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* FizzBuzz rules: | |
* | |
* Write a program that prints the numbers from 1 to 100. | |
* But for multiples of three print “Fizz” instead of the number | |
* and for the multiples of five print “Buzz”. | |
* For numbers which are multiples of both three and five print “FizzBuzz”." | |
* | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
window.findDecimal = function(x){ | |
if (typeof x === 'string') { | |
var x_str = parseFloat(x); | |
} else if (typeof x === 'number') { | |
var x_str = x.toString(); | |
} else { | |
return false; //not a string or a number | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin simpleFlex ($align, $child) { | |
display: -webkit-box; | |
display: -moz-box; | |
display: -ms-flexbox; | |
display: -webkit-flex; | |
display: flex; | |
-webkit-box-align:$align; | |
-webkit-flex-align: $align; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "compass/css3/box"; | |
@mixin box-wrap($value: nowrap) { | |
// No Webkit Box fallback. | |
-webkit-flex-wrap: $value; | |
-moz-flex-wrap: $value; | |
@if $value == nowrap { | |
-ms-flex-wrap: none; | |
} @else { | |
-ms-flex-wrap: $value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"bold_folder_labels": true, | |
"caret_extra_bottom": 2, | |
"caret_extra_top": 2, | |
"caret_style": "solid", | |
"color_scheme": "Packages/User/Monokai (SL).tmTheme", | |
"default_line_ending": "unix", | |
"draw_white_space": "all", | |
"font_size": 13, | |
"highlight_line": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* tinyRouter.js | |
* | |
* Super simple JS router class, like super super simple | |
* doesn't use any regex to match url pathnames or hashes | |
* just takes a route name, looks for that function that matches it and runs it | |
* this is really only useful in small projects where you have a few pages and not a ton of JS | |
* but enough so where you still want to keep things organized | |
* | |
* there is one reserved route name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* mini templating library using native html5 templating | |
* important to note: since html5 templating is basically a wrapper over documentFragment you need to have content nested 1 level deep. | |
* You can't grab innerHTML of the documentFragment itself, but you can for its children. | |
* @param {string} id id attribute of the template tag | |
* @param {object} tmplData data to be added to the template | |
* | |
*/ | |
var html5tmpl = (function(id, tmplData) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- source http://apple.stackexchange.com/questions/98187/applescript-the-activate-command-makes-application-half-active | |
-- tested on Mavericks, needs a Security & Privacy -> Accessibility feature turned on. | |
tell application "System Events" to tell (process 1 where frontmost is true) | |
click (button 1 where subrole is "AXZoomButton") of window 1 | |
end tell | |
activate application (path to frontmost application as text) |
OlderNewer