This file contains hidden or 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
//@version=4 | |
study(title="CTO Line", shorttitle="CTO", overlay=true, resolution="") | |
smma(src, length) => | |
smma = 0.0 | |
smma := na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1) + src) / length | |
smma | |
v1 = smma(hl2, 15) | |
m1 = smma(hl2, 19) | |
m2 = smma(hl2, 25) | |
v2 = smma(hl2, 29) |
This file contains hidden or 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
Migrator.CourseContent.import_from_elula(986, 46, 1900) | |
Migrator.CourseContent.import_from_elula(987, 46, 1931) | |
Migrator.CourseContent.import_from_elula(988, 46, 1917) | |
Migrator.CourseContent.import_from_elula(989, 46, 1899) | |
["April 2019: Character Month, 986, 1900", | |
"June 2019: Love Life Month , 987, 1931", | |
"May 2019: Spiritual Life Month, 988, 1917", | |
"Welcome to the Lifebook Membership!, 989, 1899"] |
This file contains hidden or 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 upsert(%{user_id: user_id, media_id: media_id, current_time: current_time, total_time: total_time, event_time: event_time} = data) | |
progress_percentage = nil | |
seconds_left = nil | |
on_conflict_query = from(p in Progress, | |
where: p.user_id = user_id and p.media_id = media_id and p.last_event_at < event_time, | |
update: [set: [current_time: ^current_time, total_time: ^total_time, event_time: event_time, progress: progress_percentage, seconds_left: seconds_left]]) | |
Repo.insert(data, on_conflict: on_conflict_query, conflict_target: [:user_id, :media_id]) | |
end |
This file contains hidden or 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
{ | |
"steps": { | |
"import": { | |
"robot": "/s3/import" | |
}, | |
"videos": { | |
"use": "import", | |
"robot": "/file/filter", | |
"accepts": [ | |
[ |
This file contains hidden or 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
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '~> 4.0.2' | |
gem 'hashie' | |
gem 'simple_form' | |
gem 'dropzonejs-rails' | |
gem 'settingslogic' | |
gem 'kaminari' | |
gem 'devise' |
This file contains hidden or 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
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '~> 4.0.2' | |
gem 'hashie' | |
gem 'simple_form' | |
gem 'dropzonejs-rails' | |
gem 'settingslogic' | |
gem 'kaminari' | |
gem 'devise' |
This file contains hidden or 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
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '~> 4.0.2' | |
gem 'hashie' | |
gem 'simple_form' | |
gem 'dropzonejs-rails' | |
gem 'settingslogic' | |
gem 'kaminari' | |
gem 'devise' |
This file contains hidden or 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
== Git(Hub) workflow | |
# Create new branch | |
git checkout -b <feature-branch> --track | |
git push -u origin <feature-branch> | |
<YOUR git commits> | |
# Do this often |
This file contains hidden or 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 screenshot | |
require 'capybara/util/save_and_open_page' | |
now = Time.now | |
p = "/#{now.strftime('%Y-%m-%d-%H-%M-%S')}-#{rand}" | |
Capybara.save_page body, "#{p}.html" | |
path = Rails.root.join("#{Capybara.save_and_open_page_path}" "#{p}.png").to_s | |
page.driver.render path | |
Launchy.open path | |
end |
This file contains hidden or 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
brew install --HEAD rbenv | |
brew install --HEAD ruby-build | |
brew install --HEAD https://raw.github.com/jasoncodes/homebrew/rbenv-vars/Library/Formula/rbenv-vars.rb # https://github.com/mxcl/homebrew/pull/7891 | |
brew install readline | |
brew install ctags | |
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
echo 'gem() { rbenv exec gem "$@" && rbenv rehash && hash -r; }' >> ~/.bash_profile | |
exec | |
CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline)" rbenv install 1.9.2-p290 | |
rbenv global 1.9.2-p290 |
NewerOlder