brew update
rvm get stable
rvm requirements
rvm install 2.0.0
rvm use --default 2.0.0
rvm gemset create piron
rvm gemset use piron
gem install rails
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
mkdir {pg_commit_ts,pg_dynshmem,pg_tblspc,pg_twophase,pg_stat,pg_stat_tmp,pg_replslot,pg_snapshots,pg_logical} | |
mkdir pg_logical/{snapshots,mappings} | |
mkdir pg_xlog/archive_status | |
docker run -it -v /path/to/postgres_data:/var/lib/postgres/data postgres:9.6 /bin/bash | |
gosu postgres pg_resetxlog -f /var/lib/postgres/data |
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
# elasticsearch | |
docker run --rm -v "$PWD/esdata":/usr/share/elasticsearch/data -v "$PWD/esdata/plugins":/usr/share/elasticsearch/plugins elasticsearch /usr/share/elasticsearch/bin/plugin install marvel-agent | |
docker run -d -v "$PWD/esdata":/usr/share/elasticsearch/data -v "$PWD/esdata/plugins":/usr/share/elasticsearch/plugins -p 9200:9200 -p 9300:9300 --name=elasticsearch elasticsearch | |
# kibana | |
mkdir -p kibana/installedPlugins | |
chmod 777 -R kibana | |
docker run --rm -v "$PWD/kibana/installedPlugins":/opt/kibana/installedPlugins --link some-elasticsearch:elasticsearch kibana kibana plugin --install elasticsearch/marvel/latest | |
docker run -d --name kibana -v "$PWD/kibana/installedPlugins":/opt/kibana/installedPlugins --link some-elasticsearch:elasticsearch -p 5601:5601 kibana |
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
ENV["RAILS_ENV"] = "test" | |
require File.expand_path('../../config/environment', __FILE__) | |
require 'rails/test_help' | |
require 'minitest/autorun' | |
require 'minitest/pride' | |
require 'capybara/rails' | |
class MiniTest::Spec | |
include ActiveSupport::Testing::SetupAndTeardown |
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
----- shadowsocks ------ | |
server | |
easy_install pip | |
pip install shadowsocks | |
vi /etc/shadowsocks.json | |
{ | |
"server":"server_ip", | |
"server_port":8388, | |
"local_address": "127.0.0.1", | |
"local_port":1080, |
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
$(document).ready(function () { | |
var engine = new Bloodhound({ | |
local: [ | |
'Andorra', | |
'Unitéd Arab Emirates', | |
'Antarctica' | |
], | |
datumTokenizer: Bloodhound.tokenizers.whitespace, | |
queryTokenizer: Bloodhound.tokenizers.whitespace, |
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
0453ebc067acdd2ce302c02e2313eed7452651d6b45074bc1d34596ee1c3ead6a79d89095cf391c79c6fcf24d10d638aaaae22ec66d639335862dd3ce72250a1fc c-darwin |
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
// http://stackoverflow.com/a/962890/642670 | |
function shuffle(array) { | |
var tmp, current, top = array.length; | |
if(top) while(--top) { | |
current = Math.floor(Math.random() * (top + 1)); | |
tmp = array[current]; | |
array[current] = array[top]; | |
array[top] = tmp; | |
} |
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
function run(generator, res) { | |
const ret = generator.next(res); | |
if (ret.done) return; | |
ret.value.then(function (res) { | |
run(generator, res); | |
}); | |
} | |
let count = 1; | |
function tick(time) { |
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
def get_payment_token | |
# Simulate the JavaScript bridge we would use in production | |
params = { | |
'transaction.mode' => 'CONNECTOR_TEST', | |
'channel.id' => APP_CONFIG[:paymill_pub_key], | |
'jsonPFunction' => 'function', | |
'account.number' => '4111111111111111', | |
'account.expiry.month' => '02', | |
'account.expiry.year' => '2014', | |
'account.verification' => '111', |
NewerOlder