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
function createMock<T>(mock: Partial<jest.Mocked<T> | T> = {}) { | |
const props: any = {}; | |
const p: any = new Proxy({}, { | |
get(_target, prop) { | |
if (prop in mock) return (mock as any)[prop]; | |
if (prop in props) return props[prop]; | |
if (prop === Symbol.iterator) return undefined; | |
if (prop === 'then') return undefined; | |
if (prop === '_isMockFunction') return false; | |
const fn: any = jest.fn(() => createMock()); |
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 ubuntu | |
RUN apt-get update && \ | |
DEBIAN_FRONTEND=noninteractive \ | |
apt-get install -y curl \ | |
git \ | |
build-essential \ | |
libssl-dev \ | |
zlib1g-dev \ | |
libbz2-dev \ |
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
location ~ "^/\.well-known/acme-challenge/([-_a-zA-Z0-9]*)$" { | |
default_type text/plain; | |
return 200 "$1.$letsencrypt_account_thumbprint"; | |
} |
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
Protocol 2 | |
HostKey /etc/ssh/ssh_host_ed25519_key | |
HostKey /etc/ssh/ssh_host_rsa_key | |
KexAlgorithms [email protected] | |
Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr | |
MACs [email protected],[email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,[email protected] | |
AllowGroups ssh-user | |
PasswordAuthentication no |
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
# Download GoogleTest | |
if(ENABLE_TESTS) | |
set(GTEST_VERSION 1.7.0) | |
set(GTEST_NAME gtest-${GTEST_VERSION}) | |
if(NOT IS_DIRECTORY ${CMAKE_SOURCE_DIR}/external/${GTEST_NAME}) | |
set(GTEST_ARCHIVE ${GTEST_NAME}.zip) | |
set(GTEST_URL http://googletest.googlecode.com/files/${GTEST_ARCHIVE}) | |
set(GTEST_ARCHIVE_MD5 2d6ec8ccdf5c46b05ba54a9fd1d130d7) |
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
# Lines configured by zsh-newuser-install | |
HISTFILE=~/.histfile | |
HISTSIZE=100000 | |
SAVEHIST=100000 | |
setopt appendhistory autocd histignoredups | |
unsetopt beep | |
bindkey -e | |
# End of lines configured by zsh-newuser-install | |
# The following lines were added by compinstall | |
zstyle :compinstall filename '/home/vagrant/.zshrc' |
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
Show hidden characters
{ | |
"presets": [ | |
["env", { | |
"targets": { | |
"browsers": ["Chrome >= 56"] | |
} | |
}] | |
], | |
"plugins": ["inferno"] | |
} |
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
const net = require('net'); | |
const exec = require('child_process').exec; | |
const os = require('os'); | |
function run(cmd) { | |
return new Promise((resolve, reject) => { | |
exec(cmd, (err, stdout) => { | |
if (err) { | |
return reject(err); | |
} |
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
// :-( | |
fn main() { | |
let n = (0..10) | |
.flat_map(|a0| (0..10).filter(move |&a1| a0 != a1).map(move |a1| (a0, a1))) | |
.flat_map(|(a0, a1)| (0..10).filter(move |&a2| a2 != a0 && a2 != a1).map(move |a2| (a0, a1, a2))) | |
.flat_map(|(a0, a1, a2)| (0..10).filter(move |&a3| a3 != a0 && a3 != a1 && a3 != a2).map(move |a3| (a0, a1, a2, a3))) | |
.flat_map(|(a0, a1, a2, a3)| (0..10).filter(move |&a4| a4 != a0 && a4 != a1 && a4 != a2 && a4 != a3).map(move |a4| (a0, a1, a2, a3, a4))) | |
.flat_map(|(a0, a1, a2, a3, a4)| (0..10).filter(move |&a5| a5 != a0 && a5 != a1 && a5 != a2 && a5 != a3 && a5 != a4).map(move |a5| (a0, a1, a2, a3, a4, a5))) | |
.flat_map(|(a0, a1, a2, a3, a4, a5)| (0..10).filter(move |&a6| a6 != a0 && a6 != a1 && a6 != a2 && a6 != a3 && a6 != a4 && a6 != a5).map(move |a6| (a0, a1, a2, a3, a4, a5, a6))) |
NewerOlder