This file contains 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 { rxObserver } = require('api/v0.3'); | |
const { zip, timer, from, Observable } = require('rxjs'); | |
const { take } = require('rxjs/operators'); | |
const TIMEOUT = 1; | |
const TAKE = 6; | |
const alphabet$ = from('abcdefghijklmnopqrstuvwxyz'); | |
alphabet$.pipe( |
This file contains 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 jwt from 'jsonwebtoken'; | |
interface Config { | |
teamId: string; | |
redirectUri: string; | |
keyId: string; | |
privateKey: string; | |
} | |
export default class AppleClientSecret { |
This file contains 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 {join} = require('path'); | |
module.exports = async function traverseFs(path, onFile) { | |
const stack = []; | |
let i = 0; | |
let files = await readdir(path); | |
while (i < files.length) { | |
const file = files[i]; | |
if (file.isDirectory()) { |
This file contains 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 machine = Machine({ | |
id: 'persist', | |
strict: true, | |
initial: 'idle', | |
on: { | |
UPDATE: { | |
target: 'updating', | |
}, | |
}, | |
states: { |
This file contains 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 {useState, useEffect} from 'react'; | |
import type safeAreaInsets from 'safe-area-insets' | |
type SafeAreaInsetsModule = typeof safeAreaInsets | |
export type SafeAreaInsets = Pick<SafeAreaInsetsModule, 'top' | 'right' | 'bottom' | 'left'> | |
// Written like this because of https://stackoverflow.com/q/62726153/741970 | |
export default function useSafeAreaInsets() : SafeAreaInsets { | |
const [safeInsets, setSafeInsets] = useState({ |
This file contains 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 default class MessageUpdater { | |
constructor(id, environment) { | |
this._id = id; | |
this._environment = environment; | |
} | |
update({to, body}) { | |
const dirty = this._dirty(); |
This file contains 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
var fs = require('fs'); | |
var iconv = require('iconv-lite'); | |
var input = 'Kino - Le dernier des heroes.cue'; | |
var output = 'Kino - Le dernier des heroes.utf8.cue'; | |
fs.createReadStream(input) | |
.pipe(iconv.decodeStream('win1251')) | |
.pipe(iconv.encodeStream('utf8')) | |
.pipe(fs.createWriteStream(output)); |
This file contains 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
# Which cluster are you connect to? | |
$ kubectl cluster-info | |
$ kubectl config view context | |
For more detail: https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/ | |
# What's running? | |
$ kubectl get --all-namespaces all |
This file contains 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
users | |
.toStream() | |
.transform(() -> new Transformer<ByteString, Messages.User, KeyValue<ByteString, List<KeyValue<ByteString, Messages.User>>>>() { | |
private KeyValueStore<ByteString, Messages.User> store; | |
@Override | |
public void init(ProcessorContext context) { | |
store = (KeyValueStore<ByteString, Messages.User>) context.getStateStore("users-by-login-id-index"); | |
} |
This file contains 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>project</groupId> | |
<artifactId>streams</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<name>streams</name> |
NewerOlder