Skip to content

Instantly share code, notes, and snippets.

View stuyam's full-sized avatar

Stuart Yamartino stuyam

View GitHub Profile
SELECTED_TAB=$(osascript -e "tell application \"Terminal\" to get selected tab of window 1")
ALL_ARGS="'$*'"
if [[ $ALL_ARGS =~ stg|staging ]];
then
osascript -e "tell application \"Terminal\" to set background color of $SELECTED_TAB to {65280, 49408, 1792}";
osascript -e "tell application \"Terminal\" to set normal text color of $SELECTED_TAB to {0, 0, 0}"
else
osascript -e "tell application \"Terminal\" to set background color of $SELECTED_TAB to {56320, 13568, 17664}";
osascript -e "tell application \"Terminal\" to set normal text color of $SELECTED_TAB to {65280, 65280, 65280}"
fi
@stuyam
stuyam / Change color of terminal when running heroku commands
Last active January 24, 2018 20:42
When you run heroku command on a staging server it will be yellow, else it will be red.
SELECTED_TAB=$(osascript -e "tell application \"Terminal\" to get selected tab of window 1")
ALL_ARGS="'$*'"
if [[ $ALL_ARGS =~ stg|staging ]];
then
echo "matches"
osascript -e "tell application \"Terminal\" to set background color of $SELECTED_TAB to {65280, 49408, 1792}";
osascript -e "tell application \"Terminal\" to set normal text color of $SELECTED_TAB to {0, 0, 0}"
else
echo "doesn't match"
osascript -e "tell application \"Terminal\" to set background color of $SELECTED_TAB to {56320, 13568, 17664}";
@stuyam
stuyam / Web Bacon
Last active June 1, 2016 21:52
Send Bacon on the web as an alias to send a beacon.
window.navigator.__proto__.sendBacon = function(url, data){
window.navigator.sendBeacon(url, data);
}
ffmpeg -i file-in.mov -s 700x500 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=6 > file-out.gif
<script src="https://assets.dockwa.com/white-label-form/v1/dockwa-form.js"></script>
<iframe src="https://dockwa.com/explore/destination/CHANGE-ME-TO-MARINA-SLUG/embed" id="dockwa-embed" frameborder="0" onload="resizeCrossDomainIframe('dockwa-embed', 'https://dockwa.com');fadeIn(this);" width="100%" height="1600px" style="opacity:0;"></iframe>
@stuyam
stuyam / _interpolate.scss
Last active January 5, 2016 15:47
This is a Responsive Interpolation mixin for SASS! I built it while building my Poet CSS library http://yamartino.github.io/Poet. Simple give it an element like "h1", then set the size you want that text to be on a large screen, and on a small screen, and it will handle interpolating between the two making a smooth resizing of the text.
// Responsive interpolation mixin, great for making resposive text, but can work on anything.
@mixin interpolate($elements, $min-size, $max-size, $precision: 10, $property: 'font-size', $unit: 'rem', $min-width: 360, $max-width: 960){
$increment: ($max-size - $min-size)/$precision;
@for $i from $precision through 0{
@if $i == $precision{
#{$elements}{
#{$property}: #{$max-size - $i * $increment}#{$unit};
}
} @else {
@media only screen and (min-width: #{$max-width - $i * ($max-width - $min-width)/$precision}px) {