Skip to content

Instantly share code, notes, and snippets.

inopinatus / hstore_accessor.rb
Last active Feb 22, 2019
hstore accessor class method for AR
View hstore_accessor.rb
# include from an initializer
module HstoreAccessor
def self.included(base)
module ClassMethods
def hstore_accessor(hstore_attribute, *keys)
Array(keys).flatten.each do |key|
haveaguess / HSBC.js
Created Oct 8, 2016 — forked from benjie/HSBC.js
HSBC Personal Statement to CSV
View HSBC.js
HSBC Personal Statement to CSV
Copyright: Benjie Gillam (2012)
License: WTFPL v2.0 ( )
Add the following bookmarklet to your browser:
justinmayer /
Last active Sep 20, 2019
Menlo font, patched for Powerline. Includes regular, bold, italic, and bold italic variants.
panuta / gist:1852087
Last active Apr 8, 2020
How to setup Django/Postgresql on OS X Mountain Lion using Homebrew
View gist:1852087

Command Line Tools for Xcode

Command line tools comes bundle with Xcode prior to 4.3 version. After 4.3, you need to install a separated command line tools yourself.

First, go to this url and login using Apple Developer account (Free to register)
philipbelesky /
Created Nov 23, 2015
Traverses a Grasshopper XML definition(.ghx) and extracts VB/C#/Python components to separate individual .vb/.cs/.py files
from xml.etree.ElementTree import ElementTree
import os
def ProcessGHXFile(definition_path, base_filename):
# Loads the file and sets up the XML parser
the_file = open(definition_path)
the_directory = os.path.dirname(definition_path)
the_tree = ElementTree()
IsolateTheScript(the_tree, the_directory, base_filename)
adrianhall / AppSyncAPI.yaml
Last active Nov 17, 2020
A CloudFormation template for DynamoDB + Cognito User Pool + AppSync API for the Notes tutorial
View AppSyncAPI.yaml
Description: AWS AppSync Notes API
Type: String
Description: Name of the API - used to generate unique names for resources
MinLength: 3
MaxLength: 20
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$'
masyukun / recipeTools.js
Last active Jan 3, 2021
JavaScript functions to work with exported Cronometer recipes
View recipeTools.js
* Recipe Tools v0.1
* This version exists as a GitHub Gist at
* @license
* Copyright (c) 2020 Matthew Royal
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
tomysmile /
Last active Mar 6, 2021
Setup NodeJS Production with PM2, Nginx in Ubuntu 16.04

How To Set Up a Node.js Application for Production on Ubuntu 16.04

with PM2 & Nginx

Create User

as a root, run below commands on server:

# adduser tomy
dylanmckay / facebook-contact-info-summary.rb
Last active May 6, 2021
A Ruby script for collecting phone record statistics from a Facebook user data dump
View facebook-contact-info-summary.rb
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
joeblau / git yolo
Created Feb 3, 2014
git yolo command
View git yolo
alias gityolo='git commit -am "DEAL WITH IT" && git push -f origin master'