I hereby claim:
- I am 13rac1 on github.
- I am bde (https://keybase.io/bde) on keybase.
- I have a public key whose fingerprint is 4FAF 283F 8E37 3663 B56D 7031 E167 BF6B 827F 24EF
To claim this, I am signing this object:
| --- | |
| - hosts: all | |
| gather_facts: yes | |
| ## | |
| # Create the password then create the user | |
| # | |
| - name: Users | Generate password for new user | |
| shell: makepasswd --chars=20 | |
| register: user_password |
| #!/usr/bin/env python3 | |
| # Save this in your ~/bin as `cpy` and chmod +x | |
| import code | |
| import readline | |
| import rlcompleter | |
| # Directly import all the math functions | |
| from math import * |
| #!/usr/bin/expect | |
| # Automates pairing Android and Wear emulators. | |
| # Complete process described here: http://stackoverflow.com/questions/25205888/pairing-android-and-wear-emulators | |
| # Run: ./androidwear DEVICEPORT | |
| # Expect timeout, set short. | |
| set timeout 4 | |
| # Device port on localhost [REQUIRED] | |
| set deviceport [lindex $argv 0] |
I hereby claim:
To claim this, I am signing this object:
| "Find the display width in pixels of a string given a font, point size and DPI." | |
| import freetype | |
| # Uses Freetype Python bindings:http://freetype-py.readthedocs.io/en/latest/ | |
| # Based on the FreeType Tutorial examples: | |
| # https://www.freetype.org/freetype2/docs/tutorial/step2.html | |
| # Note: This code uses bitshift by six to divide/multiply by 64 to convert | |
| # between 26.6 pixel format (i.e., 1/64th of pixels) and points. | |
| THE_STRING = "Hello World!" |
| #!/bin/sh | |
| # 2017 https://github.com/eosrei/ | |
| OPS=${1-notch,jeb} | |
| echo -n "$OPS" \ | |
| | jq --raw-input --slurp 'split(",")' - \ | |
| | curl -H "Content-type: application/json" \ | |
| -d @- \ |
I was researching how to use Golang's Template.FuncMap() and found a data access issue in:
https://www.calhoun.io/intro-to-templates-p3-functions/
The section in question:
# Making our functions globally useful
Next we need to define our function that uses a closure. This is basically a fancy way of saying we are
going to define a dynamic function that has access to variables that are not necessarily passed into it,
but are available when we define the function.
| # Reproduce with Golang | |
| # for x := 0; x < 256; x++ { | |
| # xInRadians := float64(x) / 255 * 2 * math.Pi | |
| # sinX := uint8(math.Round((math.Sin(xInRadians) + 1) / 2 * 255)) | |
| # fmt.Printf("%#02x,", sinX) | |
| # if x%8 == 7 { | |
| # fmt.Print("\n") | |
| # } | |
| # } | |
| # Based on https://gist.github.com/funkfinger/965900 but more precise. |
| if err != nil { | |
| for err != nil { | |
| fmt.Printf("%T: %#v\n", err, err) | |
| err = errors.Unwrap(err) | |
| } | |
| } | |
| # Example Output | |
| # *net.OpError: &net.OpError{Op:"read", Net:"tcp", Source:(*net.TCPAddr)(0xc00019df80), Addr:(*net.TCPAddr)(0xc00019dfb0), Err:(*os.SyscallError)(0xc000223b60)} | |
| # *os.SyscallError: &os.SyscallError{Syscall:"read", Err:0x68} | |
| # syscall.Errno: 0x68 |
| #!/bin/bash | |
| help() { | |
| echo "Usage: $0 <main_branch> <feature_branch>" | |
| echo | |
| echo "Incrementally rebases a feature branch against a target branch commit by commit to reduce" | |
| echo "the severity and complexity of the rebase merge conflicts." | |
| echo | |
| echo "Arguments:" | |
| echo " main_branch The name of the main branch you want to rebase against." |