Skip to content

Instantly share code, notes, and snippets.

View zacksiri's full-sized avatar
💜
Building the Future of Software / Arming the Rebels

Zack Siri zacksiri

💜
Building the Future of Software / Arming the Rebels
View GitHub Profile
class ApiController < ActionController::Metal
include ActionController::Helpers
include ActionController::Redirecting
include ActionController::Rendering
include ActionController::Renderers::All
include ActionController::ConditionalGet
include ActionController::MimeResponds
include ActionController::RequestForgeryProtection
include ActionController::ForceSSL
include AbstractController::Callbacks
@zacksiri
zacksiri / Gemfile
Last active December 19, 2015 05:59
for fixing capybara javascript test
# add these to your test group
group :test do
gem 'capybara'
gem 'poltergeist'
end
require 'benchmark'
class AgeGroup < Struct.new(:categories)
# def
# Hash[*AGE_CATEGORIES.keys
# .map { |r| r.map { |v|
# [v, AGE_CATEGORIES.select
# { |k, val|
# k.include?(v)
# }.values.first]
@zacksiri
zacksiri / app_name.conf
Created November 25, 2013 07:05
upstart script for unicorn app server
#/etc/init/change_this_to_your_app_name.conf
description "App Name"
author "Admin Name <admin@app.com>"
start on virtual-filesystems
stop on runlevel [06]
env PATH=/usr/local/rbenv/shims:/usr/local/rbenv/bin:/usr/local/bin:/usr/bin:/bin
env RAILS_ENV=staging # what environment
@zacksiri
zacksiri / unicorn.rb
Created November 25, 2013 07:08
unicorn.rb
# Sample verbose configuration file for Unicorn (not Rack)
#
# This configuration file documents many features of Unicorn
# that may not be needed for some applications. See
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb
# for a much simpler configuration file.
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
@zacksiri
zacksiri / app_name
Created November 25, 2013 07:49
nginx config
upstream unicorn {
server unix:/tmp/unicorn.yoobook.sock fail_timeout=0;
}
server {
server_name domain.com www.domain.com;
listen 80 default deferred;
root /opt/apps/app_path/public;
@zacksiri
zacksiri / app_name
Created November 25, 2013 07:49
nginx config
upstream unicorn {
server unix:/tmp/unicorn.app_name.sock fail_timeout=0;
}
server {
server_name domain.com www.domain.com;
listen 80 default deferred;
root /opt/apps/app_path/public;
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- Only the root user can own the Upstart name -->
<policy user="root">
<allow own="com.ubuntu.Upstart" />
</policy>
@zacksiri
zacksiri / hello.coffee
Created February 5, 2014 14:14
CoffeeScript example
console.log "Hello World"
superheroes = ["superman", "thor", "batman"]
for hero in superheroes
console.log hero
person_1 =
name: "Zack"
email: 'zack@artellectual.com'
require 'benchmark'
require 'pry'
class Fizzbuzz
def initialize(number)
@number = number
end
def self.count(number)
count = new(number)