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
| language: ruby | |
| bundler_args: --without development | |
| before_script: ./bin/ci/before_build.sh | |
| script: "bundle exec rake spec:ci" | |
| env: | |
| - CI=true | |
| rvm: | |
| - 1.8.7 | |
| - rbx-19mode | |
| - jruby-19mode |
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
| # Backbone | |
| - Models - Store data and trigger cahnge events | |
| `window.Album = Backbone.Model.extend({});` | |
| album = new Album({title: 'Abbey Road', artist: 'The Beatles'}) | |
| -- Get an attribute | |
| album.get('title') | |
| -- Set an attribute | |
| album.set({key: value}) | |
| -- Model persistent | |
| album.isNew() |
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
| pairs = GENGO_CLIENT.getServiceLanguagePairs["response"].select do |pair| | |
| pair["lc_src"] == "en" | |
| end | |
| languages = pairs.map do |pair| | |
| pair["lc_tgt"] | |
| end.uniq | |
| puts languages.inspect | |
| => ["ar", "de", "es", "es-la", "fr", "fr-ca", "id", "it", "ja", "ko", "nl", "pl", "pt", "pt-br", "ru", "sv", "th", "tr", "vi", "zh", "zh-tw", "tl", "ms"] |
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 | |
| alias gb='git branch' | |
| alias gd='git diff' | |
| alias gdm='git diff master' | |
| alias gl='git log' | |
| alias ga='git add' | |
| alias gco='git checkout' | |
| alias gc='git commit -v' | |
| alias gca='git commit -v -a' | |
| alias gba='git branch -a' |
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 Document < ActiveRecord::Base | |
| after_commit :setup, on: :create | |
| def setup | |
| update foo: :bar if needs_to_update? | |
| end | |
| def needs_to_update | |
| true | |
| 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
| function go() { | |
| console.log("Simple function call"); | |
| console.log(this === window); | |
| } | |
| go(); //prints true on console | |
| console.log(this === window) //Prints true on console. |
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
| var person = { | |
| firstName: "John", | |
| lastName : "Doe", | |
| id : 5566, | |
| fullName : function() { | |
| return this.firstName + " " + this.lastName; | |
| } | |
| }; |
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
| function go(event) { | |
| console.log(event.currentTarget === this); | |
| }; | |
| document.querySelector('.block').addEventListener('click', go); |
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
| <html> | |
| <head> </head> | |
| <body> | |
| <h1>Math</h1> | |
| <script> | |
| let temperature = 19.7; | |
| temperature = Math.round(temperature); | |
| console.log(temperature); | |
| let morningTemperature = 11; |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
| <title>SheCodes</title> | |
| <style> | |
| body { | |
| font-family: Cerebri Sans, Helvetica, Arial, sans-serif; |