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
| require 'net/http' | |
| require 'uri' | |
| app_key = "YOUR_APP_KEY" | |
| session_key = "YOUR_SESSION_ID" | |
| uri = URI.parse("https://api-ng.betstores.com/betting/betfair/services/api.betfair.com/exchange/betting/json-rpc/v1") | |
| http = Net::HTTP.new(uri.host, uri.port) | |
| http.use_ssl = true | |
| request = Net::HTTP::Post.new(uri.request_uri) |
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
| "Team 1 v Team-2".scan(/([\S\s]*)\s{1}[-|v]\s{1}([\S\s]*)/) |
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
| <snippet> | |
| <content><![CDATA[${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}}]]></content> | |
| <tabTrigger>cnm</tabTrigger> | |
| <scope>source.ruby</scope> | |
| <description>SampleClass</description> | |
| </snippet> |
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
| package main | |
| import ( | |
| "fmt" | |
| curl "github.com/andelf/go-curl" | |
| ) | |
| func main() { | |
| easy := curl.EasyInit() |
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
| curl -X POST --cert ./certs/betfair.crt --key ./certs/betfair.key https://identitysso.betfair.com/api/certlogin --header "Content-Type: application/x-www-form-urlencoded" --header "X-Application: APPLICATION_KEY" --verbose --data "username=USERNAME&password=PASSWORD" |
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
| //После установки Mac OS 10.10 похерился brew. Подробнее здесь https://github.com/Homebrew/homebrew/issues/29795 | |
| brew update | |
| /usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory | |
| /usr/local/bin/brew: line 26: /usr/local/Library/brew.rb: Undefined error: 0 | |
| //Все из-за того, что в Mac OS 10.10 по-умолчанию ruby 2.0.0 теперь стоит | |
| //Но это можно легко исправить подредактировав /usr/local/Library/brew.rb | |
| sudo vim /usr/local/Library/brew.rb | |
| //и исправив интерпретатор на |
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
| =erl_crash_dump:0.3 | |
| Sun Sep 21 19:46:07 2014 | |
| Slogan: Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,user,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_su | |
| System version: Erlang/OTP 17 [erts-6.1] [source-d2a4c20] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] | |
| Compiled: Thu Jun 26 17:08:00 2014 | |
| Taints: | |
| Atoms: 4994 | |
| =memory | |
| total: 10668648 | |
| processes: 3510784 |
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 OR REPLACE FUNCTION bet_profit(state character varying, stake float, odds float) RETURNS float AS $$ | |
| DECLARE | |
| result float := 0; | |
| half_stake float :=0; | |
| BEGIN | |
| CASE state | |
| WHEN 'in_process' THEN | |
| result := 0; | |
| WHEN 'guessed' THEN | |
| result := (stake * odds); |
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
| puts '===> INCLUDE EXAMPLE' | |
| module M1 | |
| def run | |
| puts 'M1 run' | |
| end | |
| end | |
| class C1 | |
| include M1 |
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
| =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') |
OlderNewer