Skip to content

Instantly share code, notes, and snippets.

View kot-begemot's full-sized avatar

Max Zab kot-begemot

  • TotalSig
  • Tallinn, Estonia
View GitHub Profile
@kot-begemot
kot-begemot / ethereumHD.js
Created December 31, 2021 13:28 — forked from Meshugah/ethereumHD.js
Sample HD wallet for Ethereum
const bip39 = require("bip39"); // mnemonic generator
const hdkey = require("hdkey"); // wallet lib
const ethUtil = require("ethereumjs-util"); // Used here for public address and public key generation
const mnemonic = bip39.generateMnemonic(); // generates string
const seed = bip39.mnemonicToSeedSync(mnemonic).toString('hex'); // creates seed for wallet
const root = hdkey.fromMasterSeed(seed);
const masterPrivateKey = root.privateKey.toString('hex');
@kot-begemot
kot-begemot / gist:11141789
Last active August 29, 2015 14:00
Rails assets nondigest

For some reason Github Gist was giving me 422 error on attempt to put a comment on this gist.

So I ended up with something like this

# lib/tasks/assets.rb
require 'fileutils'
 
namespace "assets:precompile" do
  desc "Create nondigest versions of defined assets"

task :nondigest => :environment do

@kot-begemot
kot-begemot / Gemfile
Created October 10, 2012 08:46
Debugger in Gemfile
# This is a nice practice, since debugger take to much time to compile.
# Another point is that this way it can be easily ignored on the CI server,
# where this is not required anyway. That might save from forgotten *require "ruby-debug"*
# and *debugger* derictives in the code
group :debug do
if RUBY_VERSION >= '1.9.0'
gem "debugger", "~> 1.1.3"
else
gem 'ruby-debug'
end