Skip to content

Instantly share code, notes, and snippets.

View bryanmikaelian's full-sized avatar

Bryan Mikaelian bryanmikaelian

View GitHub Profile
Total Accesses: 4957
Total kBytes: 2982
CPULoad: .0151129
Uptime: 150070
ReqPerSec: .0330313
BytesPerSec: 20.3476
BytesPerReq: 616.011
BusyWorkers: 1
IdleWorkers: 49
ConnsTotal: 2
@bryanmikaelian
bryanmikaelian / metal_controller.rb
Created April 12, 2015 02:34
ActionController::Metal Necessary Modules
class MetalController < ActionController::Metal
include AbstractController::Rendering
include ActionView::Layouts
include ActionController::Serialization
include ActionController::Rendering
include ActionController::Renderers::All
include ActionController::Redirecting
include AbstractController::Callbacks
include AbstractController::Helpers
include ActionController::ParamsWrapper
@bryanmikaelian
bryanmikaelian / require.coffee
Created July 11, 2013 13:45
require jquery
# app/assets/javascripts/some_controller.coffee
require ['jquery'], ($) ->
$ ->
console.log 'Page is loaded and ready to go'
@bryanmikaelian
bryanmikaelian / multiple.go
Created March 25, 2013 14:51
multiple return
package main
func main() {
doSomethingGreat(100)
}
func doSomethingGreat(i int) (int, int) {
x := i + 20
y := x + 20 - 10 + 3
return x,y
@bryanmikaelian
bryanmikaelian / router.go
Last active December 15, 2015 09:19
Mux and Go
package api
import (
"log"
"github.com/gorilla/mux"
"http"
)
func startRouter() {
(function(){
(function(){
var ship_it = "Ship It";
return function() {
console.log("Ship It");
}
})()
})()()
(function() {
})()();
def friends_circles(circle_limit = 1)
circles = []
@followings = self.followings.includes(:user)
self.followings.each do |following|
circles << following.user.circles.limit(circle_limit).first
end
circles.reject { |c| self.member_of?(c) }
end
module Jobs
class PromoRewardsJob
@queue = "social"
class << self
def perform(redeemable_promo_code_id)
@redeemable_promo_code = RedeemablePromoCode.find(redeemable_promo_code_id)
@user = @redeemable_promo_code.redeemed_by
@rewards = @redeemable_promo_code.promo_code.rewards
//= require jquery.blockUI
//= require underscore
//= require underscore.customurlscheme
//= require store-common/payments.js
//= require jquery.payment
(function(window, $, _) {
var NO_PAYMENT_REQUIRED_ATTR = "data-noPaymentRequired";