I hereby claim:
- I am mjtko on github.
- I am mjtko (https://keybase.io/mjtko) on keybase.
- I have a public key ASAjrmqPtW4B_Zzr_wzRoHIlCh85sGa6V2L2cGDMTUJMBgo
To claim this, I am signing this object:
#!/bin/bash -ex | |
FLIGHT_APPLIANCE_MENU_BRANCH=dev/vpn | |
FLIGHT_GUI_BRANCH=master | |
########Base Packages########### | |
yum -y install patch autoconf automake bison bzip2 gcc-c++ libffi-devel libtool \ | |
patch readline-devel ruby sqlite-devel zlib-devel glibc-headers glibc-devel openssl-devel make unzip wget git | |
yum -y install epel-release | |
yum -y install openvpn easy-rsa bind-utils |
I hereby claim:
To claim this, I am signing this object:
if RUBY_VERSION >= '2.0.0' | |
class Object | |
alias :_respond_to? :respond_to? | |
def respond_to?(symbol, include_all = nil) | |
_respond_to?(symbol, include_all || false).tap do |b| | |
if b == false && include_all.nil? && _respond_to?(symbol, true) | |
warn "WARNING! #{self.class.name} responds to #{symbol}, but it's protected or private (from: #{caller[2].inspect})" | |
end | |
end | |
end |
require "zlib" | |
require "stringio" | |
require "time" # for Time.httpdate | |
require 'rack/utils' | |
module Hardwired | |
class Deflater | |
DEFAULT_CONTENT_TYPES = | |
[ |
RE: teampoltergeist/poltergeist#44
Use Rack::SimpleEndpoint
to prevent Poltergeist/PhantomJS from crashing on TTF fonts.
Create config/initializers/middleware-deny-ttf-to-phantomjs-under-test.rb
:
if Rails.env.test?
require 'rack/contrib/simple_endpoint'
Rails.application.config.middleware.insert_after Rack::Runtime, Rack::SimpleEndpoint, /\.ttf$/ do |req, res|
# config/initializers/sprockets-server-monkeypatch-deny_phantomjs_ttf.rb | |
# Monkey patch under test environment that prevents PhantomJS on OSX | |
# from crashing when dealing with TTF webfonts. | |
# Note: depending on your setup, it's likely that the RUBY_PLATFORM | |
# is not actually relevant for server - it's the UA that crashes. | |
if Rails.env.test? # && RUBY_PLATFORM =~ /darwin/ | |
module Sprockets::Server | |
def call_with_env_instance_var(env) | |
@env = env |
#include <unistd.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <errno.h> | |
#define MAX_ARGS 255 | |
int main(const int argc, char** argv) { | |
const char delimiters[] = " "; | |
char *args[MAX_ARGS], *running, *token; |
require 'set' | |
class Set | |
def subset(&pred) | |
Set.new.tap do |subset| | |
each do |x| | |
subset << x if pred.call(x) | |
end | |
end | |
end |
require 'active_support/core_ext/time/calculations' | |
unless Time.method_defined?(:beginning_of_hour) | |
class Time | |
# Returns a new Time representing the start of the hour (x:00) | |
def beginning_of_hour | |
change(:min => 0) | |
end | |
alias :at_beginning_of_hour :beginning_of_hour | |
class Contact < ActiveRecord::Base | |
validates :dob, :presence => true, :if => :is_patient? | |
validates :contact_type_id, :first_name, :last_name, :presence => true | |
has_many :calls | |
belongs_to :contact_type | |
def is_patient? |