I hereby claim:
- I am xsleonard on github.
- I am sleonard (https://keybase.io/sleonard) on keybase.
- I have a public key ASAh6EnczT-cqdcVIQM4NoQ8dxy-9PQoLcVO-NIyMI37hgo
To claim this, I am signing this object:
| // For library: https://github.com/danielgindi/Charts | |
| extension BarLineChartViewBase { | |
| func focusXRange(start: Double, end: Double) { | |
| guard end > start else { | |
| return | |
| } | |
| // Reset the zoom back to the full chart view, so that the setVisibleXRange call will zoom in to the desired range, | |
| // setVisibleXRange only zooms in, not out. |
| extension Array where Element: Comparable { | |
| // Returns the location of the value in the array, | |
| // or where you should insert the value into the array. | |
| // If the value does not exist in the array, the Bool return value is false. | |
| func binarySearch(value: Element) -> (Index, Bool) { | |
| guard !isEmpty else { | |
| return (0, false) | |
| } | |
| if value > self.last! { |
| extension UUID { | |
| // UUID is 128-bit, we need two 64-bit values to represent it | |
| var integers: (Int64, Int64) { | |
| var a: UInt64 = 0 | |
| a |= UInt64(self.uuid.0) | |
| a |= UInt64(self.uuid.1) << 8 | |
| a |= UInt64(self.uuid.2) << (8 * 2) | |
| a |= UInt64(self.uuid.3) << (8 * 3) | |
| a |= UInt64(self.uuid.4) << (8 * 4) | |
| a |= UInt64(self.uuid.5) << (8 * 5) |
| extension Int64 { | |
| /* | |
| Returns the absolute distance between two Int64 values as a UInt64. | |
| A UInt64 is required to represent the range of possible distance values. | |
| */ | |
| func distanceTo(_ other: Int64) -> UInt64 { | |
| if self == other { | |
| return 0 | |
| } | |
| if self > other { |
| #!/bin/sh | |
| # Original: https://gohugo.io/hosting-and-deployment/hosting-on-github/#put-it-into-a-script | |
| # If a command fails then the deploy stops | |
| set -e | |
| printf "\033[0;32mDeploying updates to GitHub...\033[0m\n" | |
| # Clean the public folder |
| playbook | |
| ├── roles | |
| │ ├── createuser | |
| │ │ ├── tasks | |
| │ │ │ └── main.yml | |
| │ │ └── templates | |
| │ │ └── sudoers.j2 | |
| │ └── maybecreateuser | |
| │ └── tasks | |
| │ └── main.yml |
I hereby claim:
To claim this, I am signing this object:
| -- Found PkgConfig: /usr/bin/pkg-config (found version "0.26") | |
| PROCESSOR: x86_64 | |
| Machine: x86_64-linux-gnu | |
| -- Target host is 64 bit | |
| -- Looking for include file stdint.h | |
| -- Looking for include file stdint.h - found | |
| -- Looking for include file stdlib.h | |
| -- Looking for include file stdlib.h - found | |
| -- Looking for include file pthread.h | |
| -- Looking for include file pthread.h - found |
| from sys import argv | |
| from string import ascii_uppercase | |
| def map_number(number): | |
| """ Maps a number's digits to its possible phone letters """ | |
| sets = [] | |
| for n in str(number): | |
| assert n != '0' | |
| pos = (int(n) - 1) * 3 |
| unsigned char* hexstr_to_char(const char* hexstr) | |
| { | |
| size_t len = strlen(hexstr); | |
| IF_ASSERT(len % 2 != 0) | |
| return NULL; | |
| size_t final_len = len / 2; | |
| unsigned char* chrs = (unsigned char*)malloc((final_len+1) * sizeof(*chrs)); | |
| for (size_t i=0, j=0; j<final_len; i+=2, j++) | |
| chrs[j] = (hexstr[i] % 32 + 9) % 25 * 16 + (hexstr[i+1] % 32 + 9) % 25; | |
| chrs[final_len] = '\0'; |