Skip to content

Instantly share code, notes, and snippets.

Avatar
Struck by lightning

Gregor Pogačnik fiksn

Struck by lightning
View GitHub Profile
View gist:c7f1b3004fc962679ccb7132712c729e
# 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")'
View CookieMonster.sol
pragma solidity ^0.4.24;
contract CookieMonster {
struct Cookies {
uint num;
bool exists;
}
mapping (address => Cookies) map;
View gist:b72c52d010719664aca280d08d45eab6
// 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);
View gist:f183ab5f37154894aefed6e71adf5cb0
// 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);
View gist:ffd861cac8e102f4308aae92b22836bf
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 {
View gist:cd14110f9b873b1f439807653b4eed75
// 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);
View gist:b63f8eece1f0259845c1747b831d1ba7
pragma solidity ^0.4.20;
contract LatestName {
string name = "Gregor";
function setName(string newName) public {
name = newName;
}
function getName() public view returns (string) {
View keybase.md

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 Dec 11, 2014
libpthread problem
View break_pthreads.cpp
/*
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>