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
# check versions | |
git --version | |
zsh --version | |
ruby -v | |
vim -v | |
# Command line tools | |
xcode-select --install | |
echo "Command line tools installed" |
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
# frozen_string_literal: true | |
# For everything successful we can match it's value | |
RSpec::Matchers.define :hold do |expected| | |
match do |actual| | |
return false unless actual.success? | |
expect(actual.value!.inspect).to eq expected.inspect | |
end | |
failure_message do |actual| |
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
-- Create authors | |
CREATE TABLE authors(id serial PRIMARY KEY, name char(255)); | |
-- Single author of many books | |
INSERT INTO authors(name) | |
VALUES ('William Gibson'); | |
-- Collective of authors of one book | |
INSERT INTO authors(name) |
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
class Book < Hanami::Entity | |
attributes do | |
attribute :id, Types::Int | |
attribute :title, Types::String | |
attribute :author, Types::String | |
attribute :publisher, Types::String | |
end | |
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
-module(fb). | |
-export([run/0, run/1, tell/1]). | |
run() -> lists:map(fun(L) -> io:format('~p ~n', [tell(L)]) end, lists:seq(1,100)). | |
run(N) -> lists:map(fun(L) -> io:format('~p ~n', [tell(L)]) end, lists:seq(1,N)). | |
tell(N) when N rem 15 == 0 -> 'FizzBuzz'; | |
tell(N) when N rem 3 == 0 -> 'Fizz'; | |
tell(N) when N rem 5 == 0 -> 'Buzz'; |
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
# Sublime Text 3 languages list: | |
ls -1 /Applications/Sublime\ Text.app/Contents/MacOS/Packages/ | |
# Remove all default Sublime Text 3 snippets for Python language | |
export ST3_LANG="Python" | |
mkdir -p ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/$ST3_LANG/ | |
unzip -l /Applications/Sublime\ Text.app/Contents/MacOS/Packages/$ST3_LANG.sublime-package | grep '.sublime-snippet' | awk '{print $4}' | while read f; do touch ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/$ST3_LANG/$f; done | |
unset ST3_LANG |
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
class Dexter | |
# file = "/home/Rfiles/EURUSD.csv" | |
def initialize file | |
@@pair = 'EU' # For output .csv name | |
@@file = File.new file | |
@@directory = File.dirname file | |
@@head = @@file.gets.chomp.split(',') | |
@@time = Time.now |
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
<%# shared/_flash_messages.html.erb %> | |
<% flash.each do |type, message| %> | |
<div class="alert <%= bootstrap_class_for(type) %> fade in"> | |
<button class="close" data-dismiss="alert">×</button> | |
<i class='<%= bootstrap_icon_for(type) %>'></i> <%= message %> | |
</div> | |
<% 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
<% flash.each do |type, message| %> | |
<div class="alert <%= bootstrap_class_for(type) %> fade in"> | |
<button class="close" data-dismiss="alert">×</button> | |
<%= message %> | |
</div> | |
<% end %> |