I hereby claim:
- I am marz619 on github.
- I am ammaar (https://keybase.io/ammaar) on keybase.
- I have a public key whose fingerprint is 3639 9955 5DB2 0D2E F4E8 E7F3 F2A1 6018 035F 7A86
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| # args | |
| prefix=$1 | |
| replace=$2 | |
| redis='redis-cli -s /var/run/redis/redis.sock' | |
| keys=( $(redis-cli -h $host KEYS "$prefix*") ) | |
| for key in "${keys[@]}" |
| package aoc | |
| import ( | |
| "errors" | |
| "reflect" | |
| ) | |
| // rotate rotates the values of a slice by rotate positions, preserving the | |
| // rotated values by wrapping them around the slice | |
| func rotate(slice interface{}, rotate int) error { |
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| from __future__ import print_function | |
| import time | |
| from multiprocessing import cpu_count | |
| from multiprocessing.pool import ThreadPool | |
| import requests |
| package json | |
| import ( | |
| "bytes" | |
| "encoding/json" | |
| "io" | |
| ) | |
| // WriteJSON tries to encode `data` in to the provided io.Writer | |
| // |
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| "log" | |
| "math/rand" | |
| "os" | |
| "os/signal" | |
| "sync" |
| package stack | |
| import ( | |
| "reflect" | |
| "sync" | |
| ) | |
| // Stack implements Push & Pop | |
| type Stack interface { | |
| Push(interface{}) |
Using the -ldflags parameter can help set variable values at compile time.
Using the example provided here:
make build will create a build executable. Running it will result in:$> ./build
no version (Mon YYYY)
$>| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| def dird(cls): | |
| """ | |
| return a generator that yields all methods for `cls` | |
| that do not start with underscore (_) | |
| """ | |
| cn = type(cls).__name__ |
| package tristate | |
| import "sync" | |
| // State for a tristate cache | |
| type State int | |
| // cache State contants | |
| const ( | |
| Miss State = iota |