Skip to content

Instantly share code, notes, and snippets.

View shanev's full-sized avatar
💭
#BUIDL

shane.stars shanev

💭
#BUIDL
View GitHub Profile
@shanev
shanev / db-1.go
Last active January 22, 2019 09:28
// Client is a Postgres client.
// It wraps a pool of Postgres DB connections.
type Client struct {
*pg.DB
}
// NewDBClient creates a Postgres client
func NewDBClient(addr string, user string, password string, database string) *Client {
db := pg.Connect(&pg.Options{
Addr: addr,
@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:

@shanev
shanev / FaceEmotion.swift
Created April 4, 2018 13:19
Output emoji representing facial emotion for an image or video frame
import Foundation
import PlaygroundSupport
let apiKey = API_KEY
let endPointUrl = "https://westus.api.cognitive.microsoft.com/emotion/v1.0"
let url = URL(string: "\(endPointUrl)/recognize")!
let testImageString = TEST_IMAGE
struct Response: Decodable {
let scores: Score
//
// LivePhotoUtil.swift
// Blink
//
// Created by Shane Vitarana on 6/2/17.
// Copyright © 2017 Blink. All rights reserved.
//
import Alamofire
import BlinkApi