Skip to content

Instantly share code, notes, and snippets.

@jfonte
jfonte / osx-setup.md
Last active August 29, 2015 14:23 — forked from zenorocha/.hyper.js

Setup Mac OS X

I'm in a hospital in Spain and my MacBook was stolen.

Hospital Commit

Now I bought a new one and need to configure it. I have an external hard drive that backup everything using Time Machine, but I don't want all the crap I had in the old one.

1. Run Software Update

@jfonte
jfonte / unmountBak.sh
Last active April 2, 2016 18:04
unmount script superduper
#!/bin/bash
sleep 10 # give SuperDuper enough time to finish doing it's job
/usr/sbin/diskutil umount bak > /dev/null
# if you want to completely eject the disk when waking up to conserve battery life and stop the disk from spinning, then:
# diskutil eject bak (you can get the disk name by running '''diskutil cs list''' source -> http://apple.stackexchange.com/questions/153307/how-can-change-hard-disk-name-not-partition)
@jfonte
jfonte / gist:919f46dd67365650d929
Created November 3, 2015 17:09
change the time before disk goes to sleep on Mac OSX to save battery life
sudo pmset -a disksleep 1
sudo pmset -b disksleep 1
@jfonte
jfonte / rightway-exception-JS
Created February 7, 2016 16:40
right way to process JS exceptions
try{
whatever
}catch(e){
windows.location.href = "http://stackoverflow.com/search?q=[js]+"+e.message;
}
@jfonte
jfonte / objExtend.js
Created May 12, 2016 22:28 — forked from bhavyaw/objExtend.js
Native JS Extend Functionality
/**
* Object Extending Functionality
*/
var extend = function(out) {
out = out || {};
for (var i = 1; i < arguments.length; i++) {
if (!arguments[i])
continue;
for (var key in arguments[i]) {
#!/bin/bash
# sleepwatcher script to dismount ext. drives on wake https://www.kodiakskorner.com/log/258
# checks if data & bak volumes are mounted, and if so dismounts
if [[ $(mount | awk '$3 == "/Volumes/bak" {print $3}') != "" ]]; then
diskutil umount bak
fi
@jfonte
jfonte / subl
Created May 7, 2017 23:36 — forked from cmalard/subl
Cygwin + Sublime Text 3 : works with files and Git
#!/bin/bash
# To create in [.babun/]cygwin/usr/local/bin/subl with chmod +x
ARGS=""
while test $# -gt 0
do
ARGS="$ARGS ${1#/cygdrive/[a-zA-Z]}"; # Remove /cygdrive and disk letter from the path
shift
done
@jfonte
jfonte / cross-sell-custom
Created June 9, 2018 15:57
Fix height variation in slick and cross sells
#cross-sell .cross-sell img{
height: 200px;
width: auto;}
@media only screen and (max-width: 500px){
#cross-sell .cross-sell img {
height: 100px;
width: auto; }}
@media only screen and (max-width: 979px) and (min-width: 501px){
#cross-sell .cross-sell img {
@jfonte
jfonte / gist:2dd2e1ded53ed5a1892aaa1adafc225a
Last active January 23, 2019 14:34
cross-sell--wrapper mod css
<style type="text/css">
@media only screen and (max-width: 768px) {
/* For mobile phones: */
.xs-mobile-hide{
display:none !important}
}
@media only screen and (min-width: 769px) {
/* For desktop phones: */
.xs-desktop-hide{
display:none !important}