Skip to content

Instantly share code, notes, and snippets.

View paulmolluzzo's full-sized avatar

Paul Molluzzo paulmolluzzo

View GitHub Profile
@paulmolluzzo
paulmolluzzo / later.sh
Created May 16, 2017 13:34
rm all frozen now deployments
now ls | grep FROZEN | awk '{print $1}' | xargs now rm -y
@paulmolluzzo
paulmolluzzo / methodology.js
Last active October 18, 2020 02:41
Missing HTML Props
const latestAttrs = {
"*": [
"className",
"dangerouslySetInnerHTML",
"dir",
"draggable",
"hidden",
"htmlFor",
"id",
"is",
@paulmolluzzo
paulmolluzzo / author-amend.sh
Created February 16, 2017 01:15 — forked from TheCodedSelf/author-amend.sh
Change all commits with author email "[email protected]" to "[email protected]"
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="The Dark Knight"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
#!/usr/bin/env bash
# power cycle wifi because Apple laptops crap out when waking from sleep
# might need to replace 'airport' with 'en0' - the first attempt will stdout the one that worked
alias wtf='networksetup -setairportpower airport off; networksetup -setairportpower airport on'
#!/bin/bash
# checkout a pull request by ID into a new branch like: gcopr 123 new-branch-name
gcopr() {
numRegex='^[0-9]+$'
if ! [[ $1 =~ $numRegex ]]; then
echo "No ID for PR given"
else
branchname=${2-pr-$1}
git fetch origin pull/$1/head:$branchname
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@paulmolluzzo
paulmolluzzo / gist:cef3bac129cac10de909
Created August 20, 2014 16:45
Cancelling a form and resetting it
'click .cancel-edit-section': function(e) {
var parent = $(e.currentTarget).closest('.section');
$(parent).find('#section-title input').val(this.title);
$(parent).find('#section-content textarea').val(this.content);
$(parent).toggleClass('editing');
return false;
},
@paulmolluzzo
paulmolluzzo / routes.js
Created August 7, 2014 14:19
Subscribing via argument from Route
this.route('report', {
path: '/reports/:_id',
template: 'report',
data: function () {
return {
reports:Reports.findOne({_id:this.params._id})
};
},
waitOn: function(){
return subscriptionHandles.singlereport(this.params._id);
@paulmolluzzo
paulmolluzzo / helper.js
Created August 7, 2014 01:14
URL Encoding Helper for Meteor
UI.registerHelper('escapeURL', function(route, id) {
var path = Meteor.absoluteUrl() + Router.routes[route].path({_id: id}).substring(1);
return encodeURIComponent(path);
});
@paulmolluzzo
paulmolluzzo / Gruntfile.js
Created July 8, 2014 01:37
Translate Grunt
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
'prettify': {
options: {
indent: 4,
indent_char: ' ',
wrap_line_length: 0,