- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'active_support/core_ext/numeric/bytes' | |
require 'delegate' | |
require 'forwardable' | |
require 'time' | |
require 'celluloid/io' | |
require 'websocket/driver' | |
require 'webmachine' | |
require 'webmachine/adapters/rack' | |
require 'celluloid/autostart' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rx.internal.util.unsafe; | |
import java.lang.reflect.Field; | |
public class Unsafe { | |
public int getIntVolatile(Object obj, long offset) { | |
return 0; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This module allows you to prepend a version prefix to your Sinatra URLs | |
# Example: | |
# | |
# require 'rubygems' | |
# require 'sinatra/base' | |
# | |
# class App < Sinatra::Base | |
# register Versioned | |
# | |
# set :version, 'v1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module CustomTimeParser | |
extend self | |
def get_time_interval(str_format = '%h:%m:%s', i_seconds=0, options = {}) | |
a_period = {'hour' => 0, 'min' => 0, 'sec' => 0 } | |
#-- Get the correct period |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ThinkingSphinx::Index.define( | |
:incident, | |
with: :active_record, | |
delta?: false, | |
delta_processor: ThinkingSphinx::Deltas.processor_for(ThinkingSphinx::Deltas::ResqueDelta) | |
) do | |
where "incidents.deleted = 0 AND accounts.status = 'enabled'" | |
set_property group_concat_max_len: 8192 | |
indexes name, sortable: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'omniauth' | |
require 'omniauth-saml' | |
class MultiProviderSamlHandler | |
UUID_REGEX = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/ | |
attr_reader :path_prefix, :provider_name | |
def initialize(path_prefix: OmniAuth.config.path_prefix, provider_name: 'saml') | |
@path_prefix = path_prefix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :attachments do | |
task migrate_to_s3: :environment do | |
require 'aws-sdk' | |
# Define Paperclip models | |
models = [ | |
[Attachment, :data], | |
[Image, :data], | |
[MediaAppearance, :media_logo], | |
[Testimonial, :avatar_logo] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install qt5-default | |
wget http://kcachegrind.sourceforge.net/kcachegrind-0.7.4.tar.gz | |
tar xvf kcachegrind-0.7.4.tar.gz | |
cd kcachegrind-0.7.4 | |
qmake && make | |
sudo install -m 755 qcachegrind/qcachegrind /usr/local/bin | |
sudo install -m 644 qcachegrind/qcachegrind.desktop \ | |
/usr/local/share/applications/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# @see http://stackoverflow.com/questions/30040708/how-to-mount-local-volumes-in-docker-machine | |
# @see https://github.com/boot2docker/boot2docker/blob/master/doc/FAQ.md | |
################################################################################ | |
# Dependency Section # | |
# # | |
################################################################################ | |
check_deps() { | |
## Make sure commands are available |