Skip to content

Instantly share code, notes, and snippets.

View shanev's full-sized avatar
💭
#BUIDL

shane.stars shanev

💭
#BUIDL
View GitHub Profile
// GenericMutations write to the database
type GenericMutations interface {
Add(model ...interface{}) error
RegisterModel(model interface{}) error
Remove(model interface{}) error
}
// Add adds any number of models as a database rows
func (c *Client) Add(model ...interface{}) error {
return c.Insert(model...)
}
// Datastore defines all operations on the DB
// This interface can be mocked out for tests, etc.
type Datastore interface {
Mutations
Queries
}
@shanev
shanev / userChrome.css
Last active December 18, 2018 19:39
Make Firefox Quantum look native on macOS
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* Moves tab close button to left of tab */
@-moz-document url(chrome://browser/content/browser.xul) {
#TabsToolbar #tabbrowser-tabs .tabbrowser-tab:not([pinned]) .tab-close-button {
-moz-box-ordinal-group: 0 !important;
-moz-margin-start: -4px !important;
-moz-margin-end: 4px !important;
}
}
#!/bin/sh
# exit if there are any errors
set -e
# pretty output
info() {
local green="\033[1;32m"
local normal="\033[0m"
echo "[${green}INFO${normal}] $1"
#!/bin/sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
FILE="$DIR/../Design/1f64a.svg"
OUTPUT_LOCATION="$DIR/../iTunes"
# convert svg asset to png
convert -density 2000 -resize 1024x1024 -background none $FILE appicon-foreground.png
package types
import (
"path"
"reflect"
"regexp"
"strings"
sdk "github.com/cosmos/cosmos-sdk/types"
)
@shanev
shanev / ERC20Unidirectional.sol
Created October 6, 2018 05:13
An ERC20 token that can only be transferred to the address which created it
pragma solidity ^0.4.24;
import "./ERC20.sol";
/**
* @title One-way Fungible Token
*/
contract ERC20Unidirectional is ERC20 {
address private _parent;
[[constraint]]
name = "github.com/cosmos/cosmos-sdk"
version = "=0.22.0"
[[constraint]]
name = "github.com/stretchr/testify"
version = "=1.2.1"
[[constraint]]
name = "github.com/spf13/cobra"

Keybase proof

I hereby claim:

  • I am shanev on github.
  • I am blockshane (https://keybase.io/blockshane) on keybase.
  • I have a public key ASB5EbwxdHbrGJd_mvlzBuhRu-gcJIJ5StKkms19G6ggiwo

To claim this, I am signing this object: