Skip to content

Instantly share code, notes, and snippets.

Philidor Green fishbullet

View GitHub Profile
@fishbullet
fishbullet / Try-FoundationDB.md
Created Jan 25, 2019
This how-to is supposed for learning and was written for developers who wants to try the FoundationDB.
View Try-FoundationDB.md

Try FoundationDB

Purpose

This how-to is supposed for learning and was written for developers who wants to try the FoundationDB.

FoundationDB is a distributed database designed to handle large volumes of structured data across clusters of commodity servers. It organizes data as an ordered key-value store and employs ACID transactions for all operations. It is especially well-suited for read/write workloads but also has excellent performance for write-intensive workloads.

@fishbullet
fishbullet / Article.md
Last active Mar 18, 2019
Step-by-step guide how to accept bitcoin in Rails website ☺️
View Article.md

Accept bitcoin in website

Bitcoin is a decentralised digital currency which has been growing rapidly in popularity and use. You can send bitcoins to people and businesses around the world quickly, easily, and with much less fees than international wire transfers, PayPal, or Visa, e.t.c.

This is a step-by-step guide, how to accept bitcoin in your website without using the full node or third-party service like blockchain.info or blocktrail.com or any other bitcoin-wallet site.

@fishbullet
fishbullet / update_electrum.sh
Last active Jan 28, 2018
Check and download (update) last electrum version, backup wallet. Linux Only
View update_electrum.sh
#!/bin/bash
# Exit if any errors
set -e
# Working directory
cd "$HOME"
# Check curl command
if ! [ -x "$(command -v curl)" ]; then
@fishbullet
fishbullet / TestnetEthereumNetwork.md
Last active Nov 9, 2018
Setup testnet Ethereum network with Docker
View TestnetEthereumNetwork.md

Setup testnet Ethereum network with Docker

Ethereum is a decentralized platform that runs smart contracts: applications that run exactly as programmed without any possibility of downtime, censorship, fraud or third party interference.

This is step-by-step guide, how to setup testnet Ethereum network.

We'll setup ethereum testnet node in the docker container and write ruby json-rpc client. The difference between ethereum(Frontier) and testnet ethereum(Ropsten) networks is that the testnet used for development. The genesis block on the testnet was set with a very low difficulty so anyone can do minning. The coins mained in the testnet have no values. You can request some coins on the facuet or trying to mine it.

@fishbullet
fishbullet / PrivateEthereumCluster.md
Last active Feb 16, 2019
Setup private Ethereum network with Docker
View PrivateEthereumCluster.md

Setup private Ethereum network with Docker

Ethereum is a decentralized platform that runs smart contracts: applications that run exactly as programmed without any possibility of downtime, censorship, fraud or third party interference.

This is a step-by-step guide, how to setup private Ethereum network. 

We’ll set up a network and create two simple JSON-RPC clients in order to communicate with our Ethereum nodes.

@fishbullet
fishbullet / bm.rb
Last active Apr 13, 2017
benchmark
View bm.rb
n = 5000
Benchmark.bm do |x|
x.report("pluck: ") { n.times { User.pluck(:id, :name).map { |z| { id: z[0], name: z[1] } }.to_json } }
x.report("select: ") { n.times { User.select(:id, :name).to_json(only: [:id, :name]) } }
end
@fishbullet
fishbullet / howto.md
Last active Oct 24, 2017
Setup CentOS 7.1 for Rails application from scratch. Rbenv, Ruby 2.2.2, Postgres 9.4
@fishbullet
fishbullet / rails_rc.rb
Last active Aug 29, 2015
My Rails template run rails new project_name -m /path/to/template.rb
View rails_rc.rb
# minitest, capistrano, pry
gem_group :development do
gem 'puma'
gem 'capistrano', '2.15.5'
gem 'rvm-capistrano'
gem 'pry-rails', '~> 0.3.2'
end
gem_group :test do
gem 'minitest-rails'
@fishbullet
fishbullet / resolv.rb
Last active Jan 4, 2016
mail_machine part two
View resolv.rb
#!/usr/bin/env ruby
require 'resolv'
module MailMachine
class Validator
def initialize(name)
@name = name.split('@').last
end
def servers_list
@fishbullet
fishbullet / mailmachine.rb
Last active Jan 4, 2016
needed a marketing company, I spent mailing the script as usual demon
View mailmachine.rb
#!/usr/bin/env ruby
require 'net/smtp'
module MailMachine
class NetSmtp < Net::SMTP
class << self
EXCEPTIONS = [Net::SMTPAuthenticationError,
Net::SMTPServerBusy,
Net::SMTPSyntaxError,
Net::SMTPFatalError,
You can’t perform that action at this time.