This file contains 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
;; does the dynamic nature of the unsubscribe require that I send this | |
;; through the dataflaw and submit the messages with a continue? | |
[[:transform-enable (vec target-path) :select-list | |
[{msg/topic msg/app-model msg/type :unsubscribe :paths [[:list-display :bedone :todo-lists <all the other lists>]]} | |
{msg/topic msg/app-model msg/type :subscribe :paths [[:list-display :bedone :todo-lists list-id]]}]]] | |
This file contains 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
class TicTacToe | |
attr_accessor :move_pos, :prev_ttt | |
@@winning_patterns = nil | |
def initialize(_move_pos = nil, _prev_ttt = nil) | |
@move_pos, @prev_ttt = _move_pos, _prev_ttt | |
end | |
def game_over? | |
valid_moves.empty? | |
end |
This file contains 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
# run with: god -c /path/to/config.god [add -D if you want to not-deamonize god] | |
# This is the actual config file used to keep the delayed_job running | |
APPLICATION_ROOT = "/var/www/application" | |
RAILS_ENV = "production" | |
God.watch do |w| | |
w.name = "delayed_job_production" | |
w.interval = 15.seconds | |
w.start = "/bin/bash -c 'cd #{APPLICATION_ROOT}/current; /usr/bin/env RAILS_ENV=#{RAILS_ENV} #{APPLICATION_ROOT}/current/script/delayed_job start > /tmp/delay_job.out'" |
This file contains 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 bash | |
# chkconfig: 2345 99 20 | |
# description: Starts and stops delayed job | |
# hopefully | |
# processname: delayed_job | |
. /opt/elasticbeanstalk/support/envvars | |
function start() { |
This file contains 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 | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains 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 file is expecting to be in spec/javascripts/support | |
require "jammit" | |
module Jasmine | |
class Config | |
def src_files | |
if simple_config['src_files'] | |
match_files(src_dir, simple_config['src_files'] + [package_jammit_templates]) |
This file contains 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 Sass::Script::Functions | |
def dark_color(color) | |
assert_type color, :Color | |
Sass::Script::Bool.new( (color.rgb.sum / 3.0) < 128 ) | |
end | |
end |
This file contains 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
use MockClient do |base| | |
base.send(:configure) do | |
set :root, __FILE__ | |
end | |
end |
This file contains 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
width = 200 | |
height = 200 | |
mag = MiniMagick::Image.from_file( file_path ) | |
mag.combine_options do |i| | |
i.resize "#{width}x#{height}^" | |
i.gravity 'Center' | |
i.extent "#{width}x#{height}" | |
end |
This file contains 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 'rubygems' | |
require 'carrot' | |
q = Carrot.queue('tasks') | |
10.times {|x| q.publish('Message number ' + x.to_s) } | |