Skip to content

Instantly share code, notes, and snippets.

View fiksn's full-sized avatar
Struck by lightning

Gregor Pogačnik fiksn

Struck by lightning
View GitHub Profile
# Not NixOS has trouble (with non-interactive ssh)
export NIX_SSHOPTS="-q source ~/.profile 2>/dev/null;"
nix ping-store --store ssh://server && echo ok
# trusted-users in nix.conf
cat /etc/nix/nix.conf
sudo launchctl stop org.nixos.nix-daemon ; sudo launchctl start org.nixos.nix-daemon
bash $(nix-build '<nixpkgs>' -A gnu-config)/config.guess
# $ nix build '(with import <nixpkgs> { system = "x86_64-linux"; }; runCommand "foo" {} "uname > $out")'
pragma solidity ^0.4.24;
contract CookieMonster {
struct Cookies {
uint num;
bool exists;
}
mapping (address => Cookies) map;
// latest version https://github.com/ethereum/solidity/releases 0.4.24
pragma solidity ^0.4.24;
contract ERC20 {
//string public constant name = "Token Name";
//string public constant symbol = "SYM";
//uint8 public constant decimals = 18;
function totalSupply() public constant returns (uint256);
function balanceOf(address _owner) public constant returns (uint256);
// latest version https://github.com/ethereum/solidity/releases 0.4.24
pragma solidity ^0.4.24;
contract ERC20 {
//string public constant name = "Token Name";
//string public constant symbol = "SYM";
//uint8 public constant decimals = 18;
function totalSupply() public constant returns (uint256);
function balanceOf(address _owner) public constant returns (uint256);
constructor() public {
symbol = "EXAMPLE";
name = "Example token";
decimals = 18;
supply = 21000000 * 10**uint(decimals);
balances[owner] = supply;
emit Transfer(address(0), owner, supply);
}
constructor() public {
// latest version https://github.com/ethereum/solidity/releases 0.4.24
pragma solidity ^0.4.24;
contract ERC20 {
//string public constant name = "Token Name";
//string public constant symbol = "SYM";
//uint8 public constant decimals = 18;
function totalSupply() public constant returns (uint256);
function balanceOf(address _owner) public constant returns (uint256);
pragma solidity ^0.4.20;
contract LatestName {
string name = "Gregor";
function setName(string newName) public {
name = newName;
}
function getName() public view returns (string) {

Keybase proof

I hereby claim:

  • I am fiksn on github.
  • I am fiksn (https://keybase.io/fiksn) on keybase.
  • I have a public key ASCWQIEijiMCtixytfxKAxcJvYBAQmJ43IYHYV3osoU-FQo

To claim this, I am signing this object:

@fiksn
fiksn / break_pthreads.cpp
Created December 11, 2014 21:00
libpthread problem
/*
g++ -g -Wall -Werror -pipe -O3 -Wno-deprecated break_pthreads.cpp -o break_pthreads.o -c
g++ -g -pthread break_pthreads.o -o break_pthreads
./break_pthreads
*/
#include <iostream>
#include <pthread.h>
#include <stdlib.h>
#include <vector>