Skip to content

Instantly share code, notes, and snippets.

View sergio1990's full-sized avatar
🇺🇦

Serhii Herniak sergio1990

🇺🇦
View GitHub Profile
@sergio1990
sergio1990 / 01.configure
Created October 23, 2013 18:17
qt5 configure output on Mac OS 10.9
+ cd qtbase
+ /private/tmp/qt5-NNzL/qt-everywhere-opensource-src-5.1.1/qtbase/configure -prefix /usr/local/Cellar/qt5/5.1.1 -system-zlib -confirm-license -opensource -nomake examples -release -L/opt/X11/lib -I/opt/X11/include -arch x86_64
This is the Qt Open Source Edition.
You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
You have already accepted the terms of the license.
@sergio1990
sergio1990 / 02.make
Created October 23, 2013 18:19
qt5 make output on Mac OS 10.9
This file has been truncated, but you can view the full file.
cd qtbase/ && ( test -e Makefile || /private/tmp/qt5-NNzL/qt-everywhere-opensource-src-5.1.1/qtbase/bin/qmake /private/tmp/qt5-NNzL/qt-everywhere-opensource-src-5.1.1/qtbase/qtbase.pro -o Makefile ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile
cd src/ && ( test -e Makefile || /private/tmp/qt5-NNzL/qt-everywhere-opensource-src-5.1.1/qtbase/bin/qmake /private/tmp/qt5-NNzL/qt-everywhere-opensource-src-5.1.1/qtbase/src/src.pro -o Makefile ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile
cd qmake/ && ( test -e Makefile.qmake-docs || /private/tmp/qt5-NNzL/qt-everywhere-opensource-src-5.1.1/qtbase/bin/qmake /private/tmp/qt5-NNzL/qt-everywhere-opensource-src-5.1.1/qtbase/qmake/qmake-docs.pro -o Makefile.qmake-docs ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.qmake-docs
make[2]: Nothing to be done for `first'.
cd tools/bootstrap/ && ( test -e Makefile || /private/tmp/qt5-NNzL/qt-everywhere-opensource-src-5.1.1/qtbase/bin/qmake /private/tm
@sergio1990
sergio1990 / betfair_request_ssoid.rb
Last active December 22, 2016 17:24
Request ssoid for accesing API-NG betfair.com
require "net/https"
require "uri"
crt = File.read("client-2048.crt")
key = File.read("client-2048.key")
app_key = "YOUR_APP_KEY"
username = "YOUR_USERNAME"
password = "YOUR_PASSWORD"
@sergio1990
sergio1990 / betfair_request_info.rb
Created March 7, 2014 10:48
Sample requesting information from API-NG betfair
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)
@sergio1990
sergio1990 / setup_pg_for_ror_on_mac_os.bash
Last active December 28, 2015 15:04
Setup Postgresql for Rails Developers on Mac OS 10.9 Maverick
# 1. Download Postgres.app from http://www.postgresql.org/download/macosx/
# 2. Linking psql for easiest using
ln -s /Applications/Postgres.app/Contents/Versions/9.3/bin/psql /usr/local/bin/psql
# 3. Add to ~/.bash_profile
PATH="/Applications/Postgres.app/Contents/Versions/9.3/bin/:$PATH"
# 4. Now install pg gem
gem install pg
@sergio1990
sergio1990 / scan.rb
Created April 7, 2014 19:36
Split event name for teams names
"Team 1 v Team-2".scan(/([\S\s]*)\s{1}[-|v]\s{1}([\S\s]*)/)
@sergio1990
sergio1990 / classname.sublime-snippet
Created April 8, 2014 13:39
Some usefull Sublime Text 2 snippets
<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>
@sergio1990
sergio1990 / betfair_auth.go
Last active August 29, 2015 14:03
Betfair non-interactive login by golang-curl
package main
import (
"fmt"
curl "github.com/andelf/go-curl"
)
func main() {
easy := curl.EasyInit()
@sergio1990
sergio1990 / betfair_cur_auth.sh
Created July 4, 2014 11:46
Betfair non-interactive login by curl
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"
@sergio1990
sergio1990 / fix_brew.sh
Created July 31, 2014 09:52
Fix brew after Mac OS 10.10 installing
//После установки 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
//и исправив интерпретатор на