Skip to content

Instantly share code, notes, and snippets.

View pmkhoa's full-sized avatar

Khoa Pham pmkhoa

View GitHub Profile
@pmkhoa
pmkhoa / gist:580fce3cb8d2265fee0665097f316e40
Created September 30, 2016 21:29 — forked from henrik/gist:3181718
Fix "unsupported new OS, trying as if it were 10.6-10.7" from reattach-to-user-namespace on Mountain Lion (probably in tmux).
# Start by checking if they fixed it upstream:
brew update
brew upgrade reattach-to-user-namespace
# If it says it's already installed, they haven't fixed it upstream. So do this:
# Edit the recipe:
brew edit reattach-to-user-namespace
@pmkhoa
pmkhoa / google.css
Created September 6, 2016 18:02 — forked from brandonrosage/google.css
Stylesheet intended to override Google's custom search styles on the OIC website.
#cse-search-form {
position: relative;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background: #f2f2f2;
padding: 3px;
}
#dialog-container #cse-search-form {
@pmkhoa
pmkhoa / webhook-mailer.php
Created August 18, 2016 22:58 — forked from jcanfield/webhook-mailer.php
Stripe Webhook PHP Example
<?php
// SETUP:
// 1. Customize all the settings (stripe api key, email settings, email text)
// 2. Put this code somewhere where it's accessible by a URL on your server.
// 3. Add the URL of that location to the settings at https://manage.stripe.com/#account/webhooks
// 4. Have fun!
// set your secret key: remember to change this to your live secret key in production
// see your keys here https://manage.stripe.com/account
@pmkhoa
pmkhoa / migrate_postgresql_database.md
Created June 23, 2016 05:20 — forked from olivierlacan/migrate_postgresql_database.md
How to migrate a Homebrew-installed PostgreSQL database to a new major version (9.3 to 9.4) on OS X

This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.

First let's check something.

brew info postgresql

The top of what gets printed as a result is the most important:

@pmkhoa
pmkhoa / httprouterwrapper.go
Created June 13, 2016 22:11 — forked from josephspurrier/httprouterwrapper.go
Golang - Making julienschmidt/httprouter compatible using gorilla/context
// Source: http://nicolasmerouze.com/guide-routers-golang/
// Package httprouterwrapper allows the use of http.HandlerFunc compatible funcs with julienschmidt/httprouter
package httprouterwrapper
import (
"net/http"
"github.com/gorilla/context"
"github.com/julienschmidt/httprouter"
@pmkhoa
pmkhoa / meta-tags.md
Created April 20, 2016 23:27 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@pmkhoa
pmkhoa / index.html
Created April 14, 2016 21:59 — forked from MattWoelk/index.html
d3.js Loading Spinner Icon
<!DOCTYPE HTML>
<html lang="en">
<head>
</head>
<body>
<div id="loader_container"></div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
@pmkhoa
pmkhoa / components.my-component.js
Created March 17, 2016 05:03 — forked from jpadilla/components.my-component.js
Component Lifecycle Hooks
import Ember from 'ember';
export default Ember.Component.extend({
didInitAttrs(options) {
console.log('didInitAttrs', options);
},
didUpdateAttrs(options) {
console.log('didUpdateAttrs', options);
},
@pmkhoa
pmkhoa / ember-inline-toggle
Created February 4, 2016 21:03
Ember inline toggle property
<a {{action (action (mut inlineProp) (if inlineProp false true))}}>{{inlineProp}}</a>
import { test, moduleForComponent } from 'ember-qunit';
moduleForComponent('gravatar-image', 'GravatarImageComponent', {
});
test('it renders with size and e-mail', function() {
var component = this.subject();
Ember.run(function(){
component.set('size', 400);