Skip to content

Instantly share code, notes, and snippets.


Nick Merrill nick-merrill

  • Wayfair
  • Boston, MA
View GitHub Profile
marty-wang / gist:5a71e9d0a6a2c6d6263c
Last active Jan 7, 2021
Compile and deploy React Native Android app of Release version to device.
View gist:5a71e9d0a6a2c6d6263c
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/" -o "android/app/src/main/assets/"
jokester / PixelExtractor.swift
Last active Jan 18, 2021
extract pixel from a CGImage
View PixelExtractor.swift
// extract pixel from a CGImage
/* use case:
let extractor = PixelExtractor(img: UIImage(named: "gauge_vertical")!.CGImage!)
let color = extractor.color_at(x: 10, y: 20)
class PixelExtractor {
// taken from
// and adapted to swift 1.2
trcook /
Created Feb 3, 2015
auto commit git. use fswatch to setup a file to auto-commit a git repo on file change
# requires fswatch
fswatch -o . -e "\\.git.*"| xargs -n1 -I{} git commit -am "snapshot from"
maebert / latest_topic.txt
Last active Aug 29, 2018
Get notified when somebody posts a new topic in a forum
View filterable.rb
# Call scopes directly from your URL params:
# @products = Product.filter(params.slice(:status, :location, :starts_with))
module Filterable
extend ActiveSupport::Concern
module ClassMethods
# Call the class methods with names based on the keys in <tt>filtering_params</tt>
# with their associated values. For example, "{ status: 'delayed' }" would call
View meteor
# Ubuntu upstart file at /etc/init/meteor.conf
author "Tom Coleman <>"
start on runlevel [2345]
stop on runlevel [06]
respawn limit 10 5
bhollis /
Last active Jun 4, 2020
A simple, made-up example of the code for a simple AngularJS blog viewer as a more detailed exploration of . Yes, I know about `$resource`, but I prefer not to use it.
app = angular.module 'BlogExample', []
# Simple controller that loads all blog posts
app.controller 'BlogCtrl', ['$scope', 'Blog', ($scope, Blog) ->
# Get all the blog posts
Blog.all().then (posts) ->
$scope.posts = posts
# Extend the $scope with our own properties, all in one big block
# I like this because it looks like declaring a class.
burnash /
Last active Nov 3, 2019
Simple command line script to fetch a Google API's access token.
This script will attempt to open your webbrowser,
perform OAuth 2 authentication and print your access token.
It depends on two libraries: oauth2client and gflags.
To install dependencies from PyPI:
$ pip install python-gflags oauth2client
EpokK / ngEnter.js
Last active Jul 22, 2020
ngEnter directive if you can use submit form(
View ngEnter.js
app.directive('ngEnter', function() {
return function(scope, element, attrs) {
element.bind("keydown keypress", function(event) {
if(event.which === 13) {
prebenlm / .A how to display Irssi-hilights in OS X Notification
Last active Aug 12, 2019
Guide: how to make irc messages in a screen on a remote server appear in your Mac OS X Lion Notification Center with the help of terminal-notifier
View .A how to display Irssi-hilights in OS X Notification

Irssi in Mac OS X Notification Center

Mou icon


This guide will explain how you can make irc messages in a screen on a remote server appear in your Mac OS X Lion Notification Center with the help of terminal-notifier.

We will also explain how the process can be automatically started each time you log in to your Mac and ensure the connection to the server is kept alive.