View die-keystone.sh
# First, close Google Chrome. | |
# unload the Keystone agent | |
find /Library/Launch* ~/Library/LaunchAgents -maxdepth 1 -iname 'com.google.*' | xargs -L1 launchctl unload | |
# prevent it from starting again (note: you could also back up the files by moving them elsewhere) | |
find /Library/Launch* ~/Library/LaunchAgents -maxdepth 1 -iname 'com.google.*' | xargs rm -v | |
# Warning: it's likely that running Google Chrome after this will restore these files. | |
# If it doesn't, consider that automatic Chrome updates will be DISABLED. Use at own risk. |
View gh-rename-master
#!/bin/bash | |
# Usage: gh-rename-master <newbranch> [<remote>] | |
# | |
# Renames the "master" branch of the current repository both locally and on GitHub. | |
# | |
# dependencies: GitHub CLI v0.10 | |
set -e | |
newbranch="${1?}" | |
remote="${2:-origin}" |
View hub-graphql-mutation.sh
jq -R --slurp '{query: ., variables: {input: $ARGS.named}}' \ | |
--arg name "hello-world" \ | |
--arg visibility "PRIVATE" \ | |
--arg ownerId "<ORG-NODEID>" \ | |
--arg teamId "<TEAM-NODEID>" \ | |
<<<' | |
mutation ($input: CreateRepositoryInput!) { | |
createRepository(input: $input) { | |
repository { | |
nameWithOwner |
View hub-get.sh
#!/bin/bash | |
set -e | |
latest-version() { | |
curl -fsi https://github.com/github/hub/releases/latest | awk -F/ '/^Location:/ {print $(NF)}' | |
} | |
HUB_VERSION="${1#v}" | |
if [ -z "$HUB_VERSION" ]; then | |
latest=$(latest-version) || true |
View hub-api-comments.sh
comments() { | |
local issue="${1?}" | |
shift 1 | |
paginate hub api --cache 3600 graphql -F issue="$issue" "$@" -f query=' | |
query ($owner: String = "{owner}", $repo: String = "{repo}", $issue: Int!, $per_page: Int = 30, $after: String) { | |
repository(owner: $owner, name: $repo) { | |
issueOrPullRequest(number: $issue) { | |
... on Issue { | |
comments(first: $per_page, after: $after) { | |
...Comments |
View MultiLinkedList.sol
pragma solidity ^0.4.24; | |
/* | |
Title: | |
Multiple Linked List Storage | |
Description: | |
Dynamic Storage Contract for storing multiple linked lists each | |
uniquely identified by a key. Implementation allows for |
View untar.go
package main | |
import ( | |
"archive/tar" | |
"compress/gzip" | |
"fmt" | |
"io" | |
"os" | |
"path/filepath" | |
) |
View es6-symbol-iterators.js
function iterator() { | |
const self = this | |
let i = 0 | |
return { | |
next: function() { | |
return { | |
done: i === self.length, | |
value: self[i++] | |
} | |
} |
View bash_profile.sh
export EDITOR_XCODEPROJ='open -a XCode' | |
export EDITOR_TSCONFIG='code' | |
export EDITOR_DEFAULT='atom' | |
export EDITOR='magic-open' |
View nginx.conf
# primary HTTPS config | |
server { | |
listen 443 ssl; | |
server_name mislav.net; | |
ssl_certificate /etc/letsencrypt/live/mislav.net/cert.pem; | |
ssl_certificate_key /etc/letsencrypt/live/mislav.net/privkey.pem; | |
root /home/app/blog/_site; | |
index index.html; |
NewerOlder