id | name |
---|---|
1111 | The Beatles |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
require 'ostruct' | |
require 'forwardable' | |
class MockActiveRecord < OpenStruct | |
def save(opts); end | |
alias_method :save!, :save | |
def attributes | |
to_h.symbolize_keys |
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
# after cloning the repo of rbenv | |
cd ~/.rbenv | |
git pull | |
cd plugins/ruby-build | |
git pull | |
rbenv install -l | |
rbenv install 2.1.2 |
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
# Ruby API server install | |
# ------------------------ | |
# instal dev tool: git for clone, gcc & make to compile ruby, libssl-dev to compile ssl for ruby | |
# g++ is for gem dependencies | |
sudo apt-get install gcc git make libssl-dev g++ | |
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
require 'active_support/core_ext/hash' | |
require 'benchmark' | |
Benchmark.bm do |x| | |
x.report("string") do | |
1_000.times do | |
data_str = { | |
"id" => "06e99a1b-4020-4380-ab27-1a3e0c5e557c", | |
"type" => "Person", | |
"score" => "100", |
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
# Author: Diego d'Ursel | |
# --------------------- | |
# | |
# This simple lib help you to add state to a model without implementing boring functions for each state | |
# just add macro like "add_state 1, 'mystate'" to the definition of your ActiveRecord model | |
# this lib require a "state" field in the model | |
# | |
# some example of usage: | |
# --------------------- | |
# add_state 0, 'inactive' |
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
# FRENCH - POUR LES NULS | |
# Pour utiliser ce script il vous faut le language de programmation "python" installé sur votre machine (ce qui est d'origine si vous êtes sur MacOS ou un system Unix). Pour windows, il vous faudra l'installer (http://www.python.org/download), ensuite taper dans la console 'path=C:/Python__/' pour pouvoir utiliser directement python à partir de nimporte où. | |
# | |
# Utilisation: | |
# Exporter une playlist d'iTunes en fichier .txt. | |
# copier coller le script (le fichier .py) dans le dossier ou se trouve votre playlist. | |
# Ensuite ouvez un terminal et aller dans ce dossier (le commande 'cd' pour change directory vous permet de naviguer dans les dossiers, 'ls' vous affiche le contenu du dossier courant et 'pwd' vous affiche votre emplacement). | |
# Taper 'python playlist_script.py <votre_fichier.txt>' sans les '<,>' dans le dossier. | |
import sys |
event id | event name | payload |
---|---|---|
1234 | artist_was_created | artist_id: 1111, name: 'Beatles' |
1235 | artist_name_was_corrected | artist_id: 1111, new_name: 'The Beatles' |
1236 | performance_was_claimed_on_recording | performance_claim_id: 7171, user_id: 2222, recording_id: 3131, performance: 'singer' |
OlderNewer