LUAR
- Download and install lua 5.1
- Download and install luarocks
luarocks install luacrypto OPENSSL_DIR=/usr/local/opt/openssl OPENSSL_INCDIR=/usr/local/opt/openssl/include
luarocks install lapis
var obj; | |
var compound; | |
obj = function(name) { | |
var instance = { | |
name: name, | |
componenttype: obj, | |
}; | |
var components = compound(instance); | |
instance.components = components; | |
instance.event = function(name, args) { |
LUAR
luarocks install luacrypto OPENSSL_DIR=/usr/local/opt/openssl OPENSSL_INCDIR=/usr/local/opt/openssl/include
luarocks install lapis
# See https://bugsnag.com/docs/api | |
# Usage: | |
# client = BugsnagApiClient.with_token('<your account token>') | |
# data = client.with_error('<error id>').events(start_time: 5.days.ago, per_page: 30).map {|e| e['meta_data']['Custom']['target_id'] } | |
class BugsnagApiClient | |
attr_reader :rest_client | |
def self.with_token(bugsnag_auth_token) | |
rc = RestClient::Resource.new('https://api.bugsnag.com', headers: {'Authorization' => "token #{bugsnag_auth_token}"}) | |
new(rc) |
def remove_scheduled_resque_job(&block) | |
[].tap do |processed| | |
$redis.scan_each(match: "resque:delayed:*") do |key| | |
$redis.lrange(key, 0, -1).each do |value| | |
begin | |
payload = ActiveSupport::JSON.decode(value) | |
if yield(payload) | |
$redis.lrem(key, 1, value) | |
processed << value | |
end |
https://github.com/ollieglass/share-counter/blob/master/lib/share-counter.rb | |
https://urls.api.twitter.com/1/urls/count.json?url=http://www.getmdl.io/&callback=foo | |
https://api.facebook.com/method/fql.query?format=json&query=select%20share_count%20from%20link_stat%20where%20url=%22http://www.getmdl.io/%22&callback=foo | |
https://www.linkedin.com/countserv/count/share?url=http://www.getmdl.io/&callback=foo | |
https://gist.github.com/jonathanmoore/2640302#google-plus | |
https://gist.github.com/michielvaneerd/5989839 |
redis = Redis.current | |
key = "resque:queue:bulk" | |
total = redis.llen(key) | |
batch = [] | |
total.times do |i| | |
entry = redis.lpop(key) | |
batch << entry | |
if batch.size == 1000 | |
puts "re-inserting batch..." |
DatabaseConfig.Engine
should control which engine is initialized for pushDatabaseOpts
, and not be validated inside the engine driver as it currently ispushDatabaseOpts
) control locks when each engine has different lock mechanisms and requirements that may or may not allow things to be written and read at the same time. Shouldn't that go into the engine driver?- http://www.creativitypost.com/create/banish_excuses_and_boost_your_mood_to_feel_more_creative | |
A good mood is the best way to boost creativity, and here are some tips on how to get to a good mood |
# will look into all method call in instances of given class | |
module Probe | |
def self.instances(klass, opts = {}) | |
methods = if opts.is_a?(Array) | |
opts | |
else | |
methods_list(klass, opts) | |
end | |
methods.uniq.each do |m| |