Skip to content

Instantly share code, notes, and snippets.

💙

Ali shal

💙
Block or report user

Report or block shal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@shal
shal / main.go
Created Nov 13, 2019
Simple example of EEX webhook consumer in golang
View main.go
package main
import (
"encoding/json"
"flag"
"fmt"
"log"
"net/http"
"time"
)
@shal
shal / parser.go
Last active Oct 5, 2019
Parsing of big XML files using stream of tokens
View parser.go
// Parser is a command line tool for parsing big XML file.
// Author: Ali Shanaakh <hi@shal.dev>
// Usage: go run parse.go -path=./15-ufop/15.1-EX_XML_EDR_UO_03.10.2019.xml
package main
import (
"encoding/xml"
"flag"
"fmt"
"io"
@shal
shal / reflect.go
Last active Oct 2, 2019
Golang reflect play
View reflect.go
package main
import (
"errors"
"fmt"
"os"
"reflect"
"strconv"
"strings"
)
View gist:45d19895022e15f528d78bc6ddcca8c4
import { check } from "k6";
import http from "k6/http";
import { hmac } from "k6/crypto";
export let options = {
// simulate rampup of trafficm 1 to 200 users over 5 minutes.
stages: [
{ duration: "12m", target: 50 },
]
};
@shal
shal / import_members.rb
Created Aug 12, 2019
Import users generated by barong rake task to peatio
View import_members.rb
#!/usr/bin/env ruby
# Author: Ali Shanaakh <hi@shal.dev>
# Usage: import_members.rb --path=users.yml
require 'optparse'
options = {}
option_parser = OptionParser.new do |opts|
opts.banner = 'Usage: import_members.rb [options]'
@shal
shal / generate_api_keys.rake
Last active Aug 12, 2019
Modified rake task for barong api-keys generation
View generate_api_keys.rake
# frozen_string_literal: true
# To execute with optional user and api keys amount.
# rake generate:users -- -n=1000
require 'faker'
namespace 'generate' do
desc 'Build Application container'
task :users => :environment do
View faraday_bench.rb
#!/usr/bin/env ruby
require File.join(ENV.fetch('RAILS_ROOT'), 'config', 'environment')
Rails.logger.level = Logger::FATAL
module Faraday
NUMBER_OF_REQUESTS = 10000
class Ethereum
@shal
shal / cancel_min_orders.rb
Last active Jun 13, 2019
Remove orders, which have price less than minimum price.
View cancel_min_orders.rb
#!/usr/bin/env ruby
#
# Author: Ali Shanaakh <hi@shal.dev>
# Removes peatio orders, where prices less than min_ask_price.
#
# Usage:
# ./cancel_min_orders.rb
markets = ["usdeur"]
@shal
shal / debug.rb
Last active Jun 12, 2019
Debugger for cryptonodes
View debug.rb
#!/usr/bin/env ruby
# Author: Ali Shanaakh <hi@shal.dev>
# Usage: debug.rb [options]
# -c, --client=CLIENT
# -a, --address=ADDRESS
# -n, --amount=AMOUNT
# -v, --verbose
require 'net/http'
View deposit_fiats.rb
deposits = [
{ member_id: 3, currency_id: :usd, amount: 1000 }
]
deposits.map do |d|
Deposits::Fiat.create!(d).tap(&:accept!)
end
You can’t perform that action at this time.