Skip to content

Instantly share code, notes, and snippets.

View pixelbacon's full-sized avatar

Michael Minor pixelbacon

View GitHub Profile
@pixelbacon
pixelbacon / node-install.sh
Last active February 26, 2016 17:54
Install Node & NPM from source on Ubuntu
# Node & NPM & iosjs
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
nvm install node
nvm install iojs
@pixelbacon
pixelbacon / README.md
Last active March 11, 2016 08:27
Resizer config for Viewport-Resizer

Viewport Resizer is freagin awesome... But I always end up running my own set of sizes to represent modern breakpoints.

@pixelbacon
pixelbacon / divshotPushPublish.sh
Last active September 3, 2015 22:08
Divshot.io Push & Publish alias
# When using Divshot.io as a compliment to things like SS for holding your CSS and JS,
# you want to push something you already tested locally and publish without typing in
# multiple commands.
#
# At least I do. So I wrote this alias and put it in my `~/.bash_profile`.
# I'm not really going to document it's use because if you see it and don't know what
# it does, then there is a good chance you shouldn't be using it.
#
# Misuse can very easily put you in a bad spot.
alias dpush="divshot push; divshot promote development staging; divshot promote staging production;"
@pixelbacon
pixelbacon / squarespaceBreakpoints.less
Last active January 24, 2024 09:32
Squarespace Breakpoints.
/**
Squarespace essentially doesn't really document their breakpoints.
This can be quite annoying to not have when doing custom CSS.
Most themes use essentially one breakpoint. Mobile and not mobile; anything 750 and below is considered mobile.
You can use these to write your own CSS and simply use the "Style Editor" to inject your compiled CSS in the event
you are not using "Developer Mode" in your site.
Enjoy!
// Source: https://gist.github.com/pixelbacon/7754cba64125b0240504
// Inspired by:
// https://github.com/jonahvsweb/Photoshop-Automated-Resize-to-Web.jsx
// http://blog.wp.weightpoint.se/2012/02/02/batch-export-photoshop-psd-files-to-png-the-right-way/
`
// To use open Script via Photoshop OR File > Scripts > Browse
#target "photoshop"
@pixelbacon
pixelbacon / ExportPSDFolderToPNG.jsx
Last active December 12, 2019 22:59
Export folder of AI, PNG, or PSD files to PNG w/ transparency
// Source: https://gist.github.com/pixelbacon/7754cba64125b0240504
// Inspired by:
// https://github.com/jonahvsweb/Photoshop-Automated-Resize-to-Web.jsx
// http://blog.wp.weightpoint.se/2012/02/02/batch-export-photoshop-psd-files-to-png-the-right-way/
// To use open Script via Photoshop OR File > Scripts > Browse
#target "photoshop"
@pixelbacon
pixelbacon / .bash_profile
Last active September 4, 2015 18:00
~/.bash_profile
# Alias Vagrant
alias v='vagrant'
# Quick outward IP
alias myip='curl ip.appspot.com'
# DNS Flush
alias flushDNS='sudo discoveryutil udnsflushcaches' # 10.10
# alias flushDNS='dscacheutil -flushcache; sudo killall -HUP mDNSResponder' # 10.9
# alias flushDNS='sudo killall -HUP mDNSResponder' # 10.7 – 10.8
@pixelbacon
pixelbacon / MomentJS-iteration.js
Last active May 24, 2021 08:44
MomentJS iterate through daily start/end, check for clashes
var moment = require('moment'); // http://momentjs.com/docs/
var _ = require('lodash'); // https://lodash.com/docs
function(collectionsWithDateValues){
var slots = [];
var hours = {
start: 7, // 7am
end: 21, // 9pm
window: 2 // How long each item should be slotted for.
};
@pixelbacon
pixelbacon / passport-FB-Twitter-Google.js
Last active May 27, 2017 19:29
Simple Passport-Facebook, Passport-Twitter, Passport-Google redirect based on role
var express = require('express')
, router = express.Router()
, passport = require('passport');
var loginUrl = '/#/auth/login'
, redirectUrl = '/auth/redirect/'
, loggedInUrl = '/#/account'
, logoutRedirect = '/';
// Logout
@pixelbacon
pixelbacon / base64FileDecode.php
Last active January 10, 2017 17:20
Decode json base64 file string.
<?php
/**
* Takes a base64 encoded file string and returns usable information, including the re-encoded file.
* Very useful for absorbing files over JSON.
* @param $str
* @return array
* @throws Exception
*/
function base64FileDecode($str)