Skip to content

Instantly share code, notes, and snippets.

View amacgregor's full-sized avatar
:shipit:
Working on Side Projects

Allan MacGregor amacgregor

:shipit:
Working on Side Projects
View GitHub Profile
@amacgregor
amacgregor / app.css
Created March 7, 2021 00:36
Css for phoenix_fund
/* This file is for your main application css. */
@import "../node_modules/nprogress/nprogress.css";
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "./custom.css";
@amacgregor
amacgregor / postcss.config.js
Created March 7, 2021 00:35
Configuration files for phoenix_fund
module.exports = {
plugins: {
"postcss-import": {},
tailwindcss: {},
autoprefixer: {},
"postcss-nested": {}
}
}
@amacgregor
amacgregor / bspwmrc
Created May 19, 2020 17:08
Ubuntu 20.04 BSPWM + SXHD configuration
#!/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
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 January 20, 2019 20:37
Example Stock Item class without dependency injection
<?php
class StockItem {
private $quantity;
private $status;
public function __construct($quantity, $status){
$this->quantity = $quantity;
$this->status = $status;

Effective Engineer - Notes

What's an Effective Engineer?

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

Adopt the Right Mindsets

Effective Engineer - Notes

What's an Effective Engineer?

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

Adopt the Right Mindsets

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 {
// 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);