View resize_event.go
package main
import (
"os"
"os/signal"
"strconv"
"sync"
"syscall"
gc "github.com/rgburke/goncurses"
View ViewController.swift
import UIKit
import CoreLocation
class ViewController: UIViewController, CLLocationManagerDelegate {
let locationManager = CLLocationManager()
override func viewDidLoad() {
super.viewDidLoad()
// Azimuth
View winsize.go
package main
// Link against ncurses with wide character support in case goncurses doesn't
// #cgo !darwin,!freebsd,!openbsd pkg-config: ncursesw
// #cgo darwin freebsd openbsd LDFLAGS: -lncurses
// #include <stdlib.h>
// #include <locale.h>
// #include <sys/select.h>
// #include <sys/ioctl.h>
View pip_deploy.sh
pip install -U pip setuptools twine
python setup.py sdist
twine upload dist/*
View generate_htpasswd.sh
htpasswd -nbs myuser mypassword > .htpasswd
View lazy_nvm.sh
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" --no-use
alias node='unalias node ; unalias npm ; nvm use default ; node $@'
alias npm='unalias node ; unalias npm ; nvm use default ; npm $@'
View vim_optimizations.txt
- wrap autocommands in augroups
if has("autocmd")
augroup vimrc_autocmd
autocmd!
augroup END
endif
- use set foldmethod=indent (instead of syntax) for faster folding
- disable custom colorschemes
- set syntax=off
- other optimizations
View buildspec.yml
version: 0.2
phases:
pre_build:
commands:
- echo Logging in to Amazon ECR...
- aws --version
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION)
- IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- REPOSITORY_URI="$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME"
View codebuild_notes.txt
- Need to add pull/push action permissions in ECR repo and use principal `codebuild.amazonaws.com`.
- Need to add policy with `ecr:GetAuthorizationToken` to code build role (AmazonECSTaskExecutionRolePolicy).
- Need to have a `buildspec.yml` in repo root and set env vars in code build project settings.
- Need to use env docker image managed by CodeBuild.
- Need to allow CodeBuild to modify default role.
View one_billion_wei.js
web3.toBigNumber(1000000000).mul((web3.toBigNumber(10).pow(web3.toBigNumber(18)))).toString(10)
// "1000000000000000000000000000"