Skip to content

Instantly share code, notes, and snippets.


Keitaroh Kobayashi keichan34

View GitHub Profile
View puma_capacity_to_cloudwatch.rb
module PumaCapacityToCloudwatch
require 'puma_capacity_to_cloudwatch/utilization'
require 'puma_capacity_to_cloudwatch/publish'
class Error < StandardError; end
sleep 10 # wait for puma to boot up
return unless defined?(Puma)
jeremy-w /
Created Mar 10, 2017
Fish function to create or reply to a social post on 10 Centuries. MPLv2
function blurb --description Post\ to\ 10C.\\nblurb\ post\ MESSAGE\\nblurb\ POST_ID\ REPLY --argument reply_id message
set -l endpoint
set -l usage 'blurb: post or reply to a message on 10C
blurb post MESSAGE
Post a new blurb
marcelog / aws-sqs.policy
Last active Mar 19, 2021
SQS Policy to allow an S3 bucket to publish messages
View aws-sqs.policy
"Version": "2012-10-17",
"Statement": [
"Sid": "example-statement-ID",
"Effect": "Allow",
"Principal": {
"AWS": "*"
facto / Gulpfile.js
Last active Jul 10, 2019
Replacing Brunch with Gulp in Phoenix
View Gulpfile.js
// Contains support for: SASS/SCSS, concatenation, and minification for JS and CSS
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var concat = require('gulp-concat');
var compress = require('gulp-yuicompressor');
View kaminari_initializer.rb
Kaminari.configure do |config|
# config.default_per_page = 25
# config.max_per_page = nil
# config.window = 4
# config.outer_window = 0
# config.left = 0
# config.right = 0
# config.page_method_name = :page
# config.param_name = :page
jeremy-w /
Last active Aug 29, 2015
Implements Elixir's |> for Rust as pipe!.
* Compile with:
* rustc -Z unstable-options --pretty expanded
/* @file
* @author Jeremy W. Sherman (GitHub: @jeremy-w)
* @license ISC
* Implements and demonstrates use of the "pipe" (aka "thread-first") macro.
chrismccord / gist:9434b8fa208b3aae22b6
Last active Aug 29, 2015
Phoenix Upgrade Instructions 0.7.x to 0.8.0
View gist:9434b8fa208b3aae22b6

Channel Changes

The channel layer received significant features and an overhaul of the topic abstraction. Upgrade your 0.7.x channels should only require a few simple steps.

Notable changes:

  • An updated version of phoenix.js is required, replace your priv/static/js/phoenix.js with
  • "topic" is now just an identifier. You join topics, broadcast on topics, etc. Channels are are dispatched to based on topic patterns in the router.
  • Channel callbacks in 0.8.0 introduce the concept of outgoing events. Prior to 0.8.0, chanenls only processed incoming events via the event/3 callbacks. In 0.8.0, event/3 has been renamed to handle_in/3, and outgoing events callbacks can be defined via handle_out/3
  • All channel callbacks, such as join/3, leave/2, handle_in/3, and handle_out/3 now accept the socket as the last argument. This mimicks GenServer APIs
  • The return signature of handle_in, `handle_
marcoarment / ATPLogoView.m
Created Apr 29, 2014
Source for the Accidental Tech Podcast (ATP) T-Shirt
View ATPLogoView.m
// Source for the Accidental Tech Podcast (ATP) T-Shirt:
// By Marco Arment, April 28, 2014. MIT license.
@implementation ATPLogoView
- (void)drawRect:(CGRect)rectIgnored
NSString *fontName = @"MyriadPro-Semibold";
einkoro / hhvm_setcookie_fix.php
Last active Aug 29, 2015
Must-use plugin for a quick and dirty work around for HHVM indexing cookies by name and overwriting WordPress's logged_in and auth cookies.
View hhvm_setcookie_fix.php
* Plugin Name: WP HHVM setcookie fix
* Plugin URI:
* Description: Quick n dirty alternative to setcookie() to work around HHVM indexing cookies by name and overwriting multiple cookies of the same name
* Author: BitPiston Studios
* Author URI:
* Version: 1.0
* Licence: BSD
octocat / .gitignore
Created Feb 27, 2014
Some common .gitignore configurations
View .gitignore
# Compiled source #
# Packages #