- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
package repository | |
import ( | |
"context" | |
"errors" | |
"fmt" | |
"time" | |
"github.com/go-pg/pg/v10" | |
"github.com/go-pg/pg/v10/pgjson" |
{"version":1,"resource":"file:///Users/wenwei/work/shop/nooks-living/.rubocop.yml","entries":[{"id":"MzjP.yml","timestamp":1730099310285},{"id":"SJSE.yml","timestamp":1730099408032}]} |
#!/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'): |
{"sig":"f057d15d95b206ed44d8fad2ba40c1604f9063ef2fca9b46fd8902d9f07bef8980a8ab21526ddb4abe07c54e2a34a8d94d2f6088e8dc4dd459823c85e308eda20","msghash":"4cae631c768edc6be84530466c2b1dbba14e97d08ca30d33a7fd6c0b9fccc916"} |
// 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. |
gem 'will_paginate' |
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 |
# 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. |