Skip to content

Instantly share code, notes, and snippets.

View jonalport's full-sized avatar
🏠
Working from home

Jon Alport jonalport

🏠
Working from home
View GitHub Profile
@trey
trey / hubot-slack-heroku.md
Last active October 25, 2021 03:18
Steps to Install Hubot in Slack using Heroku
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@dopiaza
dopiaza / slackpost
Created September 5, 2013 12:33
Post a message to a Slack channel
#!/bin/bash
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
slackhost=PUT_YOUR_HOST_HERE
token=$1
@bensheldon
bensheldon / *rail_static_assets_on_heroku_cedar.md
Last active March 2, 2020 20:20
Serving Rails Static Assets on Heroku using a CDN with gzip and cache control

Optimizing Rails Static Assets on Heroku Cedar

Serving Rails static assets is hard, especially on Heroku Cedar where Heroku forces Rails to serve static assets itself (which isn't particularly performant nor worth your dyno-dollar)---this is different than Heroku Bamboo which used Varnish and is no more. To make the best of the situation, I highly recomend:

  1. Using the Heroku-Deflater gem which will selectively gzips assets (it gzips text-based files; and excludes images or binary files, which can actually be bigger when gzipped)

  2. Configure your production environment to set cache-control headers and get out of denial about how static assets are being served on Heroku Cedar

  3. Use AWS Cloudfront (or a CDN of your choosing) to serve the assets. Cloudfront is great because you can use the same Distribution

@erutan
erutan / Homebrew.md
Last active December 10, 2015 21:48 — forked from alanivey/Homebrew.md
Installing a custom MAMP environment on OS X via Homebrew

Installing a custom MAMP environment on OS X via Homebrew

Prerequisites

Xcode

Go to http://developer.apple.com/downloads, log in with your Apple ID (free) and download the newest version of either Command Line Tools (OS X Lion) for Xcode or Command Line Tools (OS X Mountain Lion) for Xcode. Run the installer in the dmg and you'll have the LLVM compiler, make, and other build tools.

XQuartz

@murtaugh
murtaugh / 1. single-line.html
Last active April 21, 2021 16:23
Blockquote patterns for ALA
<figure class="quote">
<blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote>
</figure>
@torifat
torifat / php-switch
Created July 30, 2012 18:11
a php switching utillity for homebrew
#!/bin/bash
# php switch for homebrew
# $ brew tap josegonzalez/php && brew install php53 --with-mysql && brew install php54 --with-mysql
# Might as well ask for password up-front, right?
sudo -v
VERSION_FILE="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/php-switch.version"
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt