react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux
/* | |
* items -- array of objects with a 'location' field | |
* userPrefs -- array of user-specified location labels, in user-specified order | |
*/ | |
function sortByLocation(items, userPrefs) { | |
return sortBy(items, userPrefs, 'location'); | |
} | |
function sortBy(items, userPrefs, column) { | |
items.sort(function(a,b) { |
react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux
# Source accepts the protocol s3:// with the host as the bucket | |
# access_key_id and secret_access_key are just that | |
s3_file "/var/bulk/the_file.tar.gz" do | |
source "s3://your.bucket/the_file.tar.gz" | |
access_key_id your_key | |
secret_access_key your_secret | |
owner "root" | |
group "root" | |
mode 0644 | |
end |
def check_for_outdated_homebrew | |
HOMEBREW_REPOSITORY.cd do | |
timestamp = if File.directory? ".git" | |
`git log -1 --format="%ct" HEAD`.to_i | |
else | |
(HOMEBREW_REPOSITORY/"Library").mtime.to_i | |
end | |
if Time.now.to_i - timestamp > 60 * 60 * 24 then <<-EOS.undent | |
Your Homebrew is outdated |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
SSD random read 150,000 ns | |
Read 1 MB sequentially from memory 250,000 ns 0.25 ms | |
Round trip within same datacenter 500,000 ns 0.5 ms |
require 'oauth_util.rb' | |
require 'net/http' | |
o = OauthUtil.new | |
o.consumer_key = 'examplek9SGJUTUpocjZ5QjBJmQ9WVdrOVVFNHdSR2x1TkhFbWNHbzlNQS0tJnM9Y29uc3VtkZXJzZWNyZXQmeD0yYg--'; | |
o.consumer_secret = 'exampled88d4109c63e778dsadcdd5c1875814977'; | |
url = 'http://query.yahooapis.com/v1/yql?q=select%20*%20from%20social.updates.search%20where%20query%3D%22search%20terms%22&diagnostics=true'; |
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by collectd configure 5.0.2, which was | |
generated by GNU Autoconf 2.67. Invocation command line was | |
$ ./configure --disable-debug --disable-dependency-tracking -C --with-python=/usr/bin --prefix=/usr/local/Cellar/collectd/5.0.2 --localstatedir=/usr/local/var | |
## --------- ## | |
## Platform. ## |
==> Downloading http://collectd.org/files/collectd-5.0.2.tar.bz2 | |
Already downloaded: /Users/toby/Library/Caches/Homebrew/collectd-5.0.2.tar.bz2 | |
/usr/bin/tar xf /Users/toby/Library/Caches/Homebrew/collectd-5.0.2.tar.bz2 | |
==> ./configure --disable-debug --disable-dependency-tracking -C --with-python=/usr/bin --prefix=/usr/local/Cellar/collectd/5.0.2 --localstatedir=/usr/local/var | |
./configure --disable-debug --disable-dependency-tracking -C --with-python=/usr/bin --prefix=/usr/local/Cellar/collectd/5.0.2 --localstatedir=/usr/local/var | |
configure: creating cache config.cache | |
checking build system type... x86_64-apple-darwin11.3.0 | |
checking host system type... x86_64-apple-darwin11.3.0 | |
checking for gcc... /usr/bin/clang | |
checking whether the C compiler works... yes |
Warning: "config" scripts exist outside your system or Homebrew directories. | |
`./configure` scripts often look for *-config scripts to determine if | |
software packages are installed, and what additional flags to use when | |
compiling and linking. | |
Having additional scripts in your path can confuse software installed via | |
Homebrew if the config script overrides a system or Homebrew provided | |
script of the same name. We found the following "config" scripts: | |
/Library/Frameworks/Python.framework/Versions/2.6/bin/python-config |
def run_pg_fouine(): | |
info = host_info[env.host_string] | |
db_name = info.tags.get('Name') | |
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 0/" /etc/postgresql/9.*/main/postgresql.conf') | |
sudo('/etc/init.d/postgresql reload') | |
time.sleep(30) | |
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 500/" /etc/postgresql/9.*/main/postgresql.conf') | |
sudo('/etc/init.d/postgresql reload') | |
run('tail -n 100000 /var/log/postgresql/postgresql-9.*-main.log > /tmp/pgfouine.txt') | |
run('gzip -f /tmp/pgfouine.txt') |