Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block bonyiii

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mikkabouzu / facebook_graph_api.rb
Last active Jan 10, 2017
Facebook Graph API w/ Koala
View facebook_graph_api.rb
### app access token
graph.get_app_access_token # => APP_TOKEN
### create test users with permissions
test_users = app_id: APP_ID, secret: APP_SECRET
user = test_users.create true, 'email,user_birthday,user_posts', name: 'Bob'
# =>
# { "id" => USER_ID,
# "access_token" => USER_ACCESS_TOKEN,
View 0. Ruby Meta Programming - spells
  • Dynamic Dispatch
  • Dynamic Method
  • Ghost Methods
  • Dynamic Proxies
  • Blank Slate
  • Kernel Method
  • Flattening the Scope (aka Nested Lexical Scopes)
  • Context Probe
  • Class Eval (not really a 'spell' more just a demonstration of its usage)
  • Class Macros
ekristen /
Last active Aug 1, 2019
Bash Script for Nagios to Check Status of Docker Container
# Author: Erik Kristensen
# Email:
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./ _container_id_
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
lackac /
Last active Aug 29, 2015
2 Ways to Decompose Fat ActiveRecord Models – budapest.rb 03/2014
View gist:8712796
int dataPin = 2;
int clockPin = 3;
int csPin = 4;
byte chars[] = {
wsargent /
Last active Jun 20, 2019
Docker cheat sheet
sheeley / SessionsController.rb
Last active Dec 25, 2015
SAML Controller for Rails (used when POSTing data to IDP and decrypting on return)
View SessionsController.rb
class SessionsController < ApplicationController
skip_before_filter :verify_authenticity_token, only: :saml
def new
request =
settings = saml_settings
request_doc = request.create_authentication_xml_doc(settings)
request_str = request_doc.to_s #.force_encoding("UTF-8")
logger.debug request_str
framallo / makefile
Last active Mar 23, 2016
This is a makefile to deploy a rails application using puma, runit and apache
View makefile
# This is the deployment recipe
# You require to install runit on the server.
# First you need to declare on which port the application will run
# echo 3000 > port
# Then you can setup a new runit service with
# make setup_service
toolmantim / Makefile
Last active Jun 8, 2018
An example of using Make instead of Grunt for fast, simple and maintainable front-end asset compilation.
View Makefile
# A simple Makefile alternative to using Grunt for your static asset compilation
## Usage
# $ npm install
# And then you can run various commands:
# $ make # compile files that need compiling
# $ make clean all # remove target files and recompile from scratch
mudge / unicorn.conf.rb
Last active Feb 9, 2017
Unicorn configuration for Rails 3.2 application to log to a different file per worker (to stop logs interleaving with one another).
View unicorn.conf.rb
after_fork do |server, worker|
# Override the default logger to use a separate log for each Unicorn worker.
Rails.logger = ActiveRecord::Base.logger = ActionController::Base.logger = begin
path = Rails.configuration.paths["log"].first
f =".log", "-#{}.log"), "a")
f.sync = true
logger =
You can’t perform that action at this time.