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
@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

@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"
@sstern6
sstern6 / gist:11f4e3ff92e0bc4052b1
Last active February 5, 2018 12:53
How To | Implement Intercom with React JS 0.14
Disclaimer : I was using Webpack with React/Flux, this is just an implementation that I got to work. Many other ways you could do this.
-Reference Intercom for more information on implementation: https://docs.intercom.io/install-on-your-web-product/integrating-intercom-in-one-page-app
Step 1) create 2 files in your apps root, chat.js and intercom.js.
Step 2) In chat.js paste in the JS library file given to you in the docs, but replace {app_id} with your actually app_id:
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;
s.src='https://widget.intercom.io/widget/{app_id}';
var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,fa
@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

@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>
@rowinf
rowinf / gist:583fcbafe28d24eae323
Last active June 7, 2021 14:15
react-chartjs line chart example
import React from 'react';
import {Line as LineChart} from 'react-chartjs';
function chartData() {
return {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [
{
label: 'My First dataset',
@trey
trey / hubot-slack-heroku.md
Last active October 25, 2021 03:18
Steps to Install Hubot in Slack using Heroku
@pwenzel
pwenzel / lamp-stack-osx-virtualhostx.md
Last active April 8, 2022 04:00
LAMP stack on OSX with Homebrew, built-in Apache, multiple PHP versions, VirtualhostX optional

This guide shows how to set up a PHP and MySQL development environment using OSX's built-in Apache, using Homebrew to install necessary components. With this strategy, you can use different versions of PHP for certain virtual hosts.

VirtualHostX is a convenient way to manage development sites, but not required.

Install PHP and MySQL with Homebrew

brew update
brew install php56
brew install php56-mcrypt
brew install mysql
@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
@brandondurham
brandondurham / styles.less
Last active January 11, 2024 06:46
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):