Skip to content

Instantly share code, notes, and snippets.

Working from boat

Davide Gessa dakk

Working from boat
View GitHub Profile
open Qiskit
(* Create the circuit *)
let qc = quantum_circuit 2 2
|> h 0
|> id 1
|> barrier
|> cx 0 1
|> barrier
|> measure 0 0
dakk / yallo_medium_1_deploy.yallo
Last active Jul 7, 2020
View yallo_medium_1_deploy.yallo
import "Token.yallo";
contract deployAToken {
field tokenAddress: address;
entry deployToken() {
let (a: address, op: operation) = Tezos.createContract (Token(Tezos.selfAddress(), 100, "ourToken"), None, 0);
this.tokenAddress = a;
dakk / yallo_medium_1_using.yallo
Created Jul 7, 2020
View yallo_medium_1_using.yallo
import "IToken.yallo";
const tokenContractAddress: address = @KT1ThEdxfUcWUwqsdergy3QnbCWGHSUHeHJq;
contract usingAToken {
field bal: nat;
entry checkBalance(a: address) {
[IToken.of(tokenContractAddress).getBalance(a, this.checkBalanceCallback)]
dakk / yallo_medium_1_contract.yallo
Created Jul 7, 2020
View yallo_medium_1_contract.yallo
contract Token implements IToken {
field balances: (address, nat) big_map;
field totalSupply: nat;
field symbol: string;
constructor (owner: address, supply: nat, symbol: string) {
this.balances = [ { owner: supply } ];
this.totalSupply = supply;
this.symbol = symbol;
dakk / yallo_medium_1_interface.yallo
Created Jul 7, 2020
View yallo_medium_1_interface.yallo
interface IToken {
entry transfer(from: address, to: address, val: nat);
view getBalance(ad: address): nat;
dakk /
Created May 14, 2019 — forked from longtimeago/
How to squash commits in a GitHub pull request

How to squash commits in a GitHub pull request

o you've contributed some code to an open source project, say, Rails. And they'd like you to squash all of the commits in your pull request. But you're not a git wizard; how do you make this happen?

Normally, you'd do something like this. I'm assuming upstream is a git remote that is pointing at the official project repository, and that your changes are in your 'omgpull' branch:

dakk /
Created Apr 10, 2019
lisk-commander: create and sign a multisig transaction
# Install lisk-commander
$ sudo npm install --global --production lisk-commander
# Transaction creation
$ lisk transaction:create -t transfer 100 ADDRESSL
? Please enter your secret passphrase: [hidden]
? Please re-enter your secret passphrase: [hidden]
# Broadcast the multisig tx
dakk /
Last active Sep 18, 2021

Tezos baking howto

This howto is valid for Betanet on Ubuntu or Debian



You have to install some dependencies. In debian / ubuntu run:

dakk / address.js
Last active Mar 26, 2018
Mastering Bitcoin - Chapter 4
View address.js
// First install bitcoinjs-lib and bip39 in the current working directory
// npm install bitcoinjs-lib bip39
const bitcoin = require ('bitcoinjs-lib');
const bip39 = require ('bip39');
/// Generate a random keypair and display private and public key and the address (compressed by default)
let keypair = bitcoin.ECPair.makeRandom ();
console.log ('Address:', keypair.getAddress());
dakk / sailaway_on_linux.bash
Last active Jan 15, 2018
How to play SailAway simulator on Linux
View sailaway_on_linux.bash
# For those attempting to install and use it on Linux, this is a quick howto (not really a bash script):
# 1. Download and install Steam with wine
# 2. Start steam and install sailaway
wine Steam.exe
# 3. Now wine will automatically use the wrong version of directx (d3d11); open winecfg, go to libraries, in
# "New override library" search for d3d11 and click "Add". Then click in d3d11 in "Existing override" and click "Edit"
# then switch the combo to "Disable"; press on "Apply" and close winecfg