Skip to content

Instantly share code, notes, and snippets.

@crystalin
crystalin / Guard Issue #161 Guardfile
Created October 14, 2011 21:03
Guard Issue #161 gemfile
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
#see http://railscasts.com/episodes/285-spork
#to run: guard
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' }, :wait => 40 do
watch('config/application.rb')
watch('config/environment.rb')
watch(%r{^app/controllers/.+\.rb$})
@crystalin
crystalin / fuze-chat.json
Last active October 17, 2019 17:07
fuze-chat.json
{
"openapi": "3.0.0",
"info": {
"title": "NgChat API",
"description": "\nAPI to manage Fuze Messaging and Calls History.<br><br>\n\n\nEndpoints can be prefixed by the one of the following prefix: <br>\n\n- `/users/<userId>`/conversations/...\n\n- `/tenants/<tenantKey>/entities/<entityId>`/conversations/....\n\n\n_(required for Service to Service requests)_\n\n\nEndpoints support idempotency by using the header \"Idempotency-Key\": <br>\n\n- Request has already been processed => returns the same output\n\n- Request is currently being processed => return 409 CONFLICT\n",
"version": "2.0.0",
"contact": {
"name": "Alan Sapede",
"email": "asapede@fuze.com"
}
This file has been truncated, but you can view the full file.
{
"name": "Moonbase Relay Testnet ",
"id": "rococo_moonbase_relay_testnet",
"chainType": "Local",
"bootNodes": [],
"telemetryEndpoints": null,
"protocolId": "dot",
"properties": null,
"forkBlocks": null,
"badBlocks": null,
This file has been truncated, but you can view the full file.
{
"name": "Moonbase Parachain Local Testnet",
"id": "local_testnet",
"chainType": "Local",
"bootNodes": [],
"telemetryEndpoints": null,
"protocolId": null,
"properties": null,
"relay_chain": "local_testnet",
"para_id": 1000,
curl https://rpc.testnet.moonbeam.network -H "Content-Type:application/json;charset=utf-8" -d '{
"jsonrpc":"2.0",
"id":1,
"method":"author_removeExtrinsic",
"params": [[{"extrinsic": "0x22ab0100040a00160000000000000000000000000000000000000000000000000000000000000000f6701e1600000000000000000000000000000000000000000000000000000000127a0000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000e2a7010060c06040523480156200001157600080fd5b50604051620068b8380380620068b883398181016040526101008110156200003857600080fd5b815160208301516040808501516060860151608087015160a088015160c089015160e08a0180519651989a9799959894979396929591949391820192846401000000008211156200008857600080fd5b9083019060208201858111156200009e57600080fd5b8251640100000000811182820188101715620000b957600080fd5b82525081516020918201929091019080838360005b83811015620000e8578181015183820152602001620000ce565b50505050905090810190601f1680156200011657808203805160018360200361010
{
"jsonrpc": "2.0",
"result": [
"0x696c040a000f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001bb7000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000031696080604052600380546001600160401b03191690553480156200002157600080fd5b50604051620019cc380380620019cc833981810160405260808110156200004757600080fd5b5080516020820151604083015160609093015191929091838383838163ffffffff8116620000a75760405162461bcd60e51b8152600401808060200182810382526027815260200180620019436027913960400191505060405180910390fd5b60208163ffffffff1610620000ee5760405162461bcd60e51b81526004018080602001828103825260228152602001806200198a6022913960400191505060405180910390fd5b6000805463ffffffff191663ffffffff83161781556002805460018181019092557f2fe54c60d3acabf3343a35b6eba15db4821b340f76e741e2249685ed4899af6c600080516020620019028339815191529091018190558154808301835592829052600080516020620019ac8339815191529
@crystalin
crystalin / playing-lights.html
Last active August 12, 2021 13:08
Playing with adafruit lights on Raspberry with python server
<head>
<script>
let actions = [];
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
function setLight(position, red, blue, green) {
@crystalin
crystalin / README.md
Last active February 12, 2022 12:58
Script to listen for balance transfer (Ethereum & Substrate)

Intro

There are multiple scenarios to trigger MOVRs transfer. You will find quick description of those below. The web3 SDK (or Ethereum API) is not sufficient to monitor all the transfers, you should use the PolkadotJs SDK (also known as the Substrate API)

Vocabulary

First, we have to consider there are 2 elements associated with a block:

  • Extrinsics (those can be considered "transactions", they are ordered by execution)
  • Events (those are generated from the extrinsic, and can be multiple per extrinsic. They are also ordered)
system.fillBlock: 0,0
system.remark: 0,1
system.setHeapPages: 0,2
system.setCode: 0,3
system.setCodeWithoutChecks: 0,4
system.setStorage: 0,5
system.killStorage: 0,6
system.killPrefix: 0,7
system.remarkWithEvent: 0,8
utility
@crystalin
crystalin / licenses.txt
Created June 21, 2023 18:29
Moonbeam Cargo License
(MIT OR Apache-2.0) AND Unicode-DFS-2016 (1): unicode-ident
0BSD OR Apache-2.0 OR MIT (1): adler
Apache-2.0 (197): approx, binary-merkle-tree, clang-sys, codespan-reporting, environmental, ethereum, evm, evm-core, evm-gasometer, evm-runtime, fdlimit, finality-grandpa, fork-tree, fp-account, fp-consensus, fp-ethereum, fp-evm, fp-rpc, fp-self-contained, fp-storage, fragile, frame-benchmarking, frame-benchmarking-cli, frame-election-provider-solution-type, frame-election-provider-support, frame-executive, frame-metadata, frame-remote-externalities, frame-support, frame-support-procedural, frame-support-procedural-tools, frame-support-procedural-tools-derive, frame-system, frame-system-rpc-runtime-api, frame-try-runtime, gethostname, hash-db, hash-db, hash256-std-hasher, hmac-drbg, libsecp256k1, libsecp256k1-core, libsecp256k1-gen-ecmult, libsecp256k1-gen-genmult, linked_hash_set, memory-db, mick-jaeger, mmr-rpc, nalgebra-macros, normalize-line-endings, orml-traits, orml-utilities, orml-xcm-support, orml-xtokens,