spec
|--- apis #do not put into controllers folder.
|--- your_api_test_spec.rb
|--- controllers
|--- models
|--- factories
|--- views
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
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; |
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
hello |
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
# Puma can serve each request in a thread from an internal thread pool. | |
# The `threads` method setting takes two numbers a minimum and maximum. | |
# Any libraries that use thread pools should be configured to match | |
# the maximum value specified for Puma. Default is set to 5 threads for minimum | |
# and maximum, this matches the default thread size of Active Record. | |
# | |
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i | |
threads threads_count, threads_count | |
# Specifies the `port` that Puma will listen on to receive requests, default is 3000. |
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 'digest/sha2' | |
module BitcoinAddress | |
extend self | |
N = [0,1,2,3,4,5,6,7,8,nil,nil,nil,nil,nil,nil,nil,9,10,11,12,13,14,15,16,nil,17,18,19,20,21,nil,22,23,24,25,26,27,28,29,30,31,32,nil,nil,nil,nil,nil,nil,33,34,35,36,37,38,39,40,41,42,43,nil,44,45,46,47,48,49,50,51,52,53,54,55,56,57] | |
def validate? address | |
g = address.bytes.inject(0){|g,n| g*58+N[n-49]}.to_s(16) | |
n = g.slice!(0..-9) | |
(n.length...42).each{n.insert(0,'0')} | |
caculate = Digest::SHA256.hexdigest(Digest::SHA256.digest(convert(n)))[0,8] | |
g == caculate ? true : false |
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
gem 'will_paginate' |
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
// Abstract contract for the full ERC 20 Token standard | |
// https://github.com/ethereum/EIPs/issues/20 | |
pragma solidity ^0.4.16; | |
contract Token { | |
/* This is a slight change to the ERC20 base standard. | |
function totalSupply() constant returns (uint256 supply); | |
is replaced with: | |
uint256 public totalSupply; | |
This automatically creates a getter function for the totalSupply. |
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
{"sig":"f057d15d95b206ed44d8fad2ba40c1604f9063ef2fca9b46fd8902d9f07bef8980a8ab21526ddb4abe07c54e2a34a8d94d2f6088e8dc4dd459823c85e308eda20","msghash":"4cae631c768edc6be84530466c2b1dbba14e97d08ca30d33a7fd6c0b9fccc916"} |
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
#!/usr/bin/env python | |
import requests | |
from bs4 import BeautifulSoup | |
import csv | |
def dump(soup): | |
table = soup.find_all("div", class_="table-responsive") | |
for t in table: | |
for tr in t.find_all('tr'): |
OlderNewer