- Record cache set/fetch time.
Fog::Cache.write_metadata({:last_refreshed => Time.now})
- Create some custom expirey method
EXPIRE_TIME = (60 * 60 * 24) # day old cache.
class StringHelper | |
def char_codes_for(str) | |
new_str = "" | |
str.each_char { |c| new_str << "&##{c.ord};" } | |
new_str | |
end | |
end |
# USAGE: | |
# reason for this is because sometimes you want to know when the originating code/comment/whatever was brought into the repo | |
# but you end up following a trace of lots of commits that just moved around the original chunk of code. | |
# this uses git bisect to trace back to the original commit that has this text in the repo. | |
# depends on ack, but you could easily change this to use `grep -r` | |
# | |
# $ git-find-original "some search string that you want to find the original commit that had this exact text" | |
match_arg="$@" |
class Tail | |
class << self | |
def tail(path, n) | |
file = File.open(path, "r") | |
buffer_s = 512 | |
line_count = 0 | |
file.seek(0, IO::SEEK_END) | |
offset = file.pos # we start at the end |
require 'uri' | |
def safe_comparison(matrix) | |
matrix.map do |row| | |
row.map do |el| | |
el = el.to_s | |
end | |
end | |
end |
%{ | |
Lilypond notation for Christian's guitar solo on https://www.youtube.com/watch?v=mOnhcdAMInA | |
%} | |
\header{ | |
title = "Christian Charlie 7/11 solo" | |
} |
====================== | |
I VI II V progression | |
====================== | |
Assuming you can | |
1) Substitute the minor IV for a dominant IV and the minor II for a dominant II | |
2) Substitue any of the VI/II's (because of #1) or V for a tritone equivalent | |
So...Some notation/glossary for the below: |
irb(main):001:0> foo = "i like food" | |
=> "i like food" | |
irb(main):002:0> foo["food"] = "beer" | |
=> "beer" | |
irb(main):003:0> foo | |
=> "i like beer" |
require 'fog' | |
require 'fog/aws' | |
ec2 = Fog::Compute.new :provider => 'AWS', :region => 'us-east-1' | |
Fog::Cache.namespace_prefix = "benchmark-test" | |
begin | |
servers = Fog::Cache.load(Fog::Compute::AWS::Server, ec2) | |
puts "found cache." |
Fog::Cache.write_metadata({:last_refreshed => Time.now})
EXPIRE_TIME = (60 * 60 * 24) # day old cache.
class MyCache | |
def self.all(resource_klass, connection, meth, args = nil) | |
cachemsg = "resource #{resource_klass} connection #{connection.class} for #{Fog::Cache.namespace_prefix}: M:#{meth} A:#{args}" | |
if MyCache.renew? | |
info("Renewing cache now. Cache is non existant or older than #{EXPIRE_TIME} seconds.") | |
Fog::Cache.expire_cache!(resource_klass, connection) | |
end |