- watch for ActiveRecord Relation, like
has_many
,has_many :through
- watch for
user_roles
, `group_users - UPDATE
action
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
el: | |
i18n: | |
transliterate: | |
rule: | |
α: a | |
ά: a | |
Α: a | |
Ά: a | |
β: v | |
Β: v |
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
check process redis-server | |
with pidfile "/var/run/redis.pid" | |
start program = "/etc/init.d/redis-server start" | |
stop program = "/etc/init.d/redis-server stop" | |
if 2 restarts within 3 cycles then timeout | |
if totalmem > 100 Mb then alert | |
if children > 255 for 5 cycles then stop | |
if cpu usage > 95% for 3 cycles then restart | |
if failed host 127.0.0.1 port 6379 then restart | |
if 5 restarts within 5 cycles then timeout |
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
# config/initializers/source_maps.rb | |
if Rails.env.development? | |
require 'open3' | |
module CoffeeScript | |
class SourceMapError < StandardError; end; | |
class << self | |
def map_dir |
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
// Open the debug tools | |
// load the function using | |
// This requires the target site to have jquery loaded as $ | |
$('<script src="https://rawgithub.com/skmp/textteaser/master/tease.js"></script>').appendTo('body'); | |
//Use directly from console | |
//(replace with proper selectors for your page) | |
tease($('.title-selector').text(), $('.content-selector').text()) |
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 ruby | |
require 'gosu' # gem install gosu --no-document | |
include Gosu | |
$dimension, $splits = 200, 20 | |
$size = $dimension.to_f / $splits.to_f | |
class Worm | |
attr_writer :dir | |
def initialize() reset 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
#!/usr/bin/env ruby | |
require 'koala' # gem install koala --no-document | |
require 'psych' | |
# create a facebook app and get access token from here | |
# https://developers.facebook.com/tools/explorer | |
# select "user_groups" when authenticating | |
oauth_access_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
group_name = 'Egyptian Geeks' | |
posts_limit = 100 | |
graph = Koala::Facebook::API.new(oauth_access_token) |
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 calls to a resource collection path adding an 'ids' param with comma separated ids, e.g. /posts?ids="1,2,3" | |
Ember.RESTAdapter.reopen findMany: (klass, records) -> | |
url = @buildURL(klass) | |
params = ids: records._ids.join(",") | |
@ajax(url, params).then (data) -> | |
collectionKey = Ember.get(klass, "collectionKey") | |
dataToLoad = (if collectionKey then Ember.get(data, collectionKey) else data) |
OlderNewer