An script for installing latest version of php via phpenv and phpbuild.
curl https://gist.githubusercontent.com/nicooga/0412767048fbdb4953fd76f88bce7825/raw/install_php.sh | bash
class window.Mail | |
constructor: (@attrs)-> | |
from_email: -> @attrs['from_email'] | |
to_email: -> @attrs['to_email'] | |
subject: -> @attrs['subject'] | |
body: -> @attrs['body'] || @attrs_dll() | |
is_valid: -> @from_email()? && @to_email()? && @subject()? && @body()? |
require 'gosu' | |
ANIMATION_INTERVAL = 0.4 | |
module GameOfLife | |
class Cell | |
attr_accessor :x, :y | |
def initialize(hash) | |
raise 'Bad attribute keys' unless (hash.keys - [:x, :y, :alive]).empty? |
Professor.available_at_or_around_or_partially start_time: Time.now, end_time: Time.now.+(2.hours) | |
SELECT "professors".* | |
INNER JOIN "professor_availability_periods" | |
ON "professor_availability_periods"."professor_id" = "professors"."id" | |
WHERE | |
( | |
( | |
/* available_at */ | |
("professor_availability_periods"."starts_at_sfsow" <= 446340) |
require "awesome_print" | |
module LinkedList | |
class Node < Struct.new(:head, :tail) | |
undef :head= | |
undef :tail= | |
end | |
def self.unshift(list, el) | |
Node.new(el, list) |
module Search | |
def run(query, params) | |
filters.inject(query) do |memo, filter| | |
filter.call(memo, params) | |
end | |
end | |
def filter(arg, options = {}) | |
case arg | |
when Symbol |
defmodule Flattening do | |
def flatten([]), do: [] | |
def flatten([head | tail]) when is_list(head), do: flatten(head) ++ flatten(tail) | |
def flatten([head | tail]), do: [head | flatten(tail)] | |
end | |
IO.inspect Flattening.flatten([[1,2,[3]],[4]]) | |
IO.inspect Flattening.flatten([[1,2,[3]],[4], [5]]) | |
IO.inspect Flattening.flatten([[1,2,[3]],[4], [5, [[6]]]]) | |
IO.inspect Flattening.flatten([[1,2,[3]],[4], [5, [[6]]], [7]]) |
module BaseFactory | |
extend ActiveSupport::Concern | |
include ActiveData::Model | |
included do | |
delegate :pipe, to: :new | |
end | |
class_methods do | |
def defop(name, &block) |
Talent factory meant to speed up manual testing process, based on Eugene Mironov's code.
Just throw files in /lib and use in console.
Factory methods can be chained and used both from class or instances.
TalentFactory.new(vertical: :desginer).create_user.pass_application_submission.claim_english # ...
TalentFactory.create_developer_on_english_step