Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Working on Side Projects

Allan MacGregor amacgregor

:shipit:
Working on Side Projects
View GitHub Profile
@amacgregor
amacgregor / bspwmrc
Created May 19, 2020
Ubuntu 20.04 BSPWM + SXHD configuration
View bspwmrc
#!/bin/sh
# Configure the workspaces
for monitor in $(bspc query -M); do
bspc monitor $monitor -d 1 2 3 4 5 6 7 8 9
done
sxhkd &> /var/log/sxhkd.log &
bspc config border_width 1
View solution.ex
defmodule UniqueStrings do
@moduledoc """
Combinatronics exercise
reference: https://www.codewars.com/kata/586c7cd3b98de02ef60001ab/train/elixir
Goal: Calculate permutations without repetition
Formula: P(n,r)=n!(n−r)!
"""
def uniq_count(string) do
string = String.upcase(string)
@amacgregor
amacgregor / StockItem.php
Created Jan 20, 2019
Example Stock Item class without dependency injection
View StockItem.php
<?php
class StockItem {
private $quantity;
private $status;
public function __construct($quantity, $status){
$this->quantity = $quantity;
$this->status = $status;
View Effective_Engineer.md

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

View Effective_Engineer.md

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

View HeroToken_Basic.sol
pragma solidity ^0.4.18;
contract HeroToken {
/* This creates an array with all balances */
mapping (address => uint256) public balanceOf;
/* Initializes contract with initial supply tokens to the creator of the contract */
function HeroToken(
uint256 initialSupply
) public {
View erc20_sample.sol
// https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
function totalSupply() constant returns (uint totalSupply);
function balanceOf(address _owner) constant returns (uint balance);
function transfer(address _to, uint _value) returns (bool success);
function transferFrom(address _from, address _to, uint _value) returns (bool success);
function approve(address _spender, uint _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint remaining);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
View eth_hero5.sh
Geth
Version: 1.7.3-stable
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.9.2
Operating System: darwin
GOPATH=
GOROOT=/usr/local/Cellar/go/1.9.2/libexec
View eth_hero4.json
{
"config": {
"chainId": 24,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"nonce": "0x0000000000000042",
"timestamp": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
View eth_hero3.sh
WARN [12-22|15:32:55] No etherbase set and no accounts found as default
INFO [12-22|15:32:55] Allocated cache and file handles database=/Users/.../ethereum_0hero/TestNetData/geth/chaindata cache=16 handles=16
INFO [12-22|15:32:55] Writing custom genesis block
INFO [12-22|15:32:55] Successfully wrote genesis state database=chaindata hash=6231b0…a0300b
INFO [12-22|15:32:55] Allocated cache and file handles database=/Users/.../ethereum_0hero/TestNetData/geth/lightchaindata cache=16 handles=16
INFO [12-22|15:32:55] Writing custom genesis block
INFO [12-22|15:32:55] Successfully wrote genesis state database=lightchaindata hash=6231b0…a0300b
You can’t perform that action at this time.