This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[allow(dead_code, non_upper_case_globals)] | |
pub mod code { | |
const x: &'static str = "X string"; | |
const y: &'static str = "Y string"; | |
const z: &'static str = "another string"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSRegionArch2AMI": { | |
"ap-northeast-1": { | |
"amd64XhvmXebsXssd": "ami-5d38d93c", | |
"amd64XhvmXephemeral": "ami-0b31d06a", | |
"amd64XebsXssd": "ami-f537d694", | |
"amd64Xephemeral": "ami-0522c364" | |
}, | |
"ap-southeast-1": { | |
"amd64XhvmXebsXssd": "ami-a35284c0", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit -o nounset -o pipefail | |
sudo patch -p0 <<\ASLCONF | |
--- /etc/asl.conf 2016-05-18 22:05:48.000000000 -0700 | |
+++ /etc/asl.conf 2016-05-18 22:06:16.000000000 -0700 | |
@@ -20,8 +20,8 @@ | |
# ignore "internal" facility | |
? [= Facility internal] ignore | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT *, | |
now() - xact_start AS duration | |
FROM pg_stat_activity, | |
LATERAL (SELECT array_agg(relation::regclass) AS locks | |
FROM pg_locks JOIN pg_class ON (pg_class.oid = relation) | |
WHERE relkind = 'r' AND pg_stat_activity.pid = pg_locks.pid) | |
AS _ | |
WHERE pid != pg_backend_pid(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit -o nounset -o pipefail | |
# This is not fast...8K/s on a 30cm MacBook | |
function base64decode { | |
local b64='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | |
local shifts=( 16 8 0 ) | |
local n=0 val=0 idx=0 padding=0 suffix= code= char= | |
cut -d, -f2 | # Throw away data:..., if data URI | |
tr -c "$b64=" -d | # Throw away formatting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import MutableMapping | |
from contextlib import contextmanager | |
import errno | |
from fcntl import flock, LOCK_EX, LOCK_NB, LOCK_SH, LOCK_UN | |
import itertools | |
import os | |
import signal | |
from threading import RLock | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# strace -s 80 -o /tmp/swift.log -- swift <(echo '1 + 1') ; fgrep -C 40 'opening import' /tmp/swift.log | |
# <unknown>:0: error: opening import file for module 'SwiftShims': No such file or directory | |
stat("/usr/local/lib/swift/clang/include", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 | |
stat("/usr/local/include", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 | |
stat("/usr/local/usr/include", 0x7ffe1f9c52c0) = -1 ENOENT (No such file or directory) | |
stat("/usr/local/usr", 0x7ffe1f9c51d0) = -1 ENOENT (No such file or directory) | |
open("/usr/local/System/Library/CoreServices/SystemVersion.plist", O_RDONLY) = -1 ENOENT (No such file or directory) | |
stat("/tmp/org.llvm.clang.root/ModuleCache/modules.timestamp", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 | |
brk(0x6481000) = 0x6481000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fonte: http://gohorseprocess.wordpress.com | |
1- Pensou, não é XGH. | |
XGH não pensa, faz a primeira coisa que vem à mente. Não existe | |
segunda opção, a única opção é a mais rápida. | |
2- Existem 3 formas de se resolver um problema, a correta, a errada e | |
a XGH, que é igual à errada, só que mais rápida. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Namedtuple annotation. | |
Creates a namedtuple out of a class, based on the signature of that class's | |
__init__ function. Defaults are respected. After namedtuple's initializer is | |
run, the original __init__ is run as well, allowing one to assign synthetic | |
parameters and internal book-keeping variables. (Note that the original | |
__init__ may not assign to the variables in its signature, because these | |
variables are made immutable by namedtuple). | |
The class must not have varargs or keyword args. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.gnupg.gpg-agent</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/bin/gpg-agent</string> |