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.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
public class ConcurrentCommands { | |
public static void main(String[] args) { | |
// Create and start threads for each command | |
Thread thread1 = new Thread(() -> executeCommand("tail -f foo.log")); | |
Thread thread2 = new Thread(() -> executeCommand("tail -f bar.log")); |
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
openapi: 3.0.0 | |
servers: | |
- url: https://management-test.adyen.com/v1 | |
info: | |
version: '1' | |
x-publicVersion: true | |
title: Management API | |
description: 'Configure and manage your Adyen company and merchant accounts, stores, | |
and payment terminals. |
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
# starts a http server at this port | |
:5000 | |
reverse_proxy 127.0.0.1:8000 { | |
# TODO: pick Forwarded for header | |
header_up Host {remote_host} | |
# header_up Host hardcoded-url.githubpreview.dev | |
# header_up X-Forwarded-Host nobody.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
import collections | |
import itertools | |
import functools | |
import re | |
class Node: | |
def __init__(self, val): | |
self.val = val |
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
<!-- | |
Welcome to Tailwind Play, the official Tailwind CSS playground! | |
Everything here works just like it does when you're running Tailwind locally | |
with a real build pipeline. You can customize your config file, use features | |
like `@apply`, or even add third-party plugins. | |
Feel free to play with this example if you're just learning, or trash it and | |
start from scratch if you know enough to be dangerous. Have fun! | |
--> |
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 { login, authenticate } from './auth'; | |
jest.mock('./auth'); | |
test('can add', () => { | |
expect(2 + 2).toBe(4) | |
}); | |
test('function mock', () => { | |
const mockFn = jest.fn(() => 42); |
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
// the array must be passed as a mutable reference (&mut) to change | |
fn change(x: &mut [i16], y: i16) { | |
x[x.len() - 1] = y; | |
} | |
fn main() { | |
let mut arr = [127, 0, 0, 1]; | |
println!("Before: {:?}", arr); | |
change(&mut arr, 255); |
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 Html exposing (text) | |
type Card s = Card s | |
stringCard = Card "foo" | |
intCard = Card 123 | |
boolCard = Card False | |
name : Card String -> String | |
-- pattern match argument |
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
module Main exposing (Pos(..), Position, Possible(..), Three, Velocity, getXPos, getY, main, nada, p, position, s, s1, s2, s2f, someStatus, someVel, sumStatus, tupair, velocity, xv, yv) | |
import Html | |
main = | |
Html.text "Ellm" | |
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
// instruction set | |
enum Op { | |
Add(i8, i8), | |
Sub(i8, i8), | |
Not(i8), | |
And(i8, i8), | |
Or(i8, i8), | |
} | |
fn eval(command: &Op) -> i8 { |
NewerOlder