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
export function mongo(name: string): KRoot[] { | |
return [ | |
deploymentOf(name, { | |
name, | |
image: 'mongo:4-bionic', | |
ports: [{ containerPort: 27017 }], | |
readinessProbe: { | |
exec: { command: ['mongo', '--eval', '{ ping: 1 }'] }, | |
}, | |
}), |
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
interface A { a: number } | |
interface B { b: number } | |
function ifIs<T>(l: Array<A | B>, isT: (o: any) => o is T, handle: (t: T) => void) { | |
for (const o of l) { | |
if (isT(o)) { | |
handle(o); | |
} | |
} | |
} |
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
#![feature(process_exitcode_placeholder)] | |
#![feature(never_type)] | |
use std::process::ExitCode; | |
fn app() -> Result<!, ()> { | |
Err(()) | |
} | |
fn main() -> ExitCode { |
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
[[products]] | |
name = "potato" | |
available = true | |
[products.shelf] | |
row = 7 | |
column = 12 | |
[[products]] | |
name = "tomato" | |
available = true |
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 fs = require('fs'); | |
const fsp = fs.promises; | |
const util = require('util'); | |
const readFile = util.promisify(fs.readFile); | |
fs.writeFileSync('a', 'a'); | |
const attempts = 10000; |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>io.github.egg</groupId> | |
<artifactId>egg</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<name>egg</name> | |
<dependencies> |
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
// Here's a .java file, named 'Yellow.java' | |
// Inside a package (and directory) named 'green' | |
package green; | |
// Here's a class named 'Blue' | |
class Blue { | |
// Here's a method named 'foo' inside 'Blue' | |
void foo() { |
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
import java.io.FileInputStream; | |
import java.io.IOException; | |
public class A { | |
static long checkHeader(String path) throws IOException { | |
// can't use try() as there's no way to catch only the initialisation exception? | |
final FileInputStream fis; | |
try { | |
fis = new FileInputStream(path); | |
} catch (IOException e) { |
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
/* | |
% npm install typescript | |
.. warnings blah blah.. | |
+ [email protected] | |
updated 1 package and audited 2 packages in 0.538s | |
found 0 vulnerabilities | |
% node_modules/.bin/tsc --lib es2018,dom --target es2018 --strict --noImplicitReturns --noImplicitAny --out hello.js hello.ts |
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
import fdb | |
import json | |
import sys | |
import decimal | |
import datetime | |
def js(val): | |
if type(val) == int: | |
return val | |
if type(val) == str: |