Skip to content

Instantly share code, notes, and snippets.

Adding one or more validators to the same node

This is the follow up from the Guide to join kiln for running more than one validator in the same node.

Why?

  • If we have many keys, no need to spin up the new machine, or running the new instance of geth/beacon.
  • Maybe you want to try to get the validator slashed by running the new validator with the same key

How?

@turboza
turboza / superfarm_investigation.md
Last active February 23, 2021 07:48
Investigating Superfarm IDO issues on Polkastarters
@turboza
turboza / ecto_data_not_update_experiment.ex
Last active February 5, 2019 07:50
A confusing moment for Ecto when the data in the database is not updated when doing `Repo.update()`
defmodule Experiment do
alias SampleApp.{Repo, Order}
def run do
order = Repo.get(Order, 123)
order.status # => "new"
# Put status as "pending" while doing some action
{:ok, _} =
order

Keybase proof

I hereby claim:

  • I am turboza on github.
  • I am turboza (https://keybase.io/turboza) on keybase.
  • I have a public key ASCKNEVoh1UZMz6lTnEiM7t4819Yo9feslX4TnD28EZGEwo

To claim this, I am signing this object:

@turboza
turboza / clean_node_modules.sh
Created July 31, 2017 03:48
Recursively Clean all node_modules in your projects to save a lot of space
#!/bin/sh
find . -name "node_modules" -exec rm -rf '{}' +
@turboza
turboza / omise_express_charge_card.js
Last active April 27, 2017 16:22
Sample of charging card using Node.js express
const omise = require('omise')({
secretKey: 'skey_test_...',
});
app.post('/pay', function(req, res) {
const tokenId = req.body.tokenId,
omise.charges.create({
description: 'Charge for order ID: 888',
amount: '100000', // 1,000 Baht
@turboza
turboza / 1-closure-issue.js
Last active October 3, 2016 05:07
Closure gotcha
/*
* This code snippet give an unexpected result because the closure (function inside function)
* that will preserve the local variable "i" eventhough buildAction is finished
* So every action in array will refer to the same "i" which is 4 after finishing loop.
*
* Result :(
* ```
* "item 4 = undefined"
* "item 4 = undefined"
* "item 4 = undefined"
@turboza
turboza / paramSerialize.js
Created September 20, 2016 13:14
Parameter serializer to create URL query string from nested objects.
/**
* =========================================
* paramSerialize
* =========================================
* Serialize JS object into URL Query string format.
*
* @param {object} params - { a: 10, filters: { x: 2, y: true } }
* @return {string} - '?a=10&filters[x]=2&filters[y]=true'
*/
export default function paramSerialize(params) {
@turboza
turboza / moveViewUp.m
Created January 19, 2014 14:35
[iOS] Ready made Code for moving up the View up when you bring up the Keyboard Ref: http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present
#define kOFFSET_FOR_KEYBOARD 80.0
-(void)keyboardWillShow {
// Animate the current view out of the way
if (self.view.frame.origin.y >= 0)
{
[self setViewMovedUp:YES];
}
else if (self.view.frame.origin.y < 0)
{