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
version: '3.1' | |
services: | |
local-mongo: | |
image: mongo:5.0.6 | |
restart: always | |
ports: | |
- 27017:27017 |
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 | |
mogrify -quality 30 *.JPG | |
img2pdf *.JPG --output book.pdf |
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.IOException | |
import zio.{Chunk, RefM, Runtime, UIO, URIO, ZIO, console, random} | |
import zio.console.Console | |
import zio.random.Random | |
import zio.stream.{SubscriptionRef, ZStream} | |
// Full running example for the ZIO documentation https://zio.dev/docs/datatypes/stream/subscription-ref | |
object Subscription extends App { |
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 square(x) { | |
return x * x; | |
} | |
function* sumSquares(values) { | |
let result = 0; | |
for (value of values) { | |
const nextIncrement = yield square(value); | |
console.log(`inside sumSquares: ${nextIncrement}`); | |
result += nextIncrement; |
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 NumberIndexes { | |
[key: number]: number; | |
} | |
const input: string = '0,13,1,16,6,17'; | |
function withTimings<T>(f: () => T): T { | |
const startTime = new Date().getTime(); | |
const result = f(); | |
const endTime = new Date().getTime(); |
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
(define (force x) | |
(x)) | |
(define (stream-numbers-from n) | |
(cons | |
n | |
(lambda () (stream-numbers-from (+ n 1))))) | |
(define (stream-multiples-of n) | |
(stream-map |
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 | |
alias view-staged-diff="git diff --staged > ~/temp/changes.diff && gedit ~/temp/changes.diff &" | |
alias view-diff="git diff > ~/temp/changes.diff && gedit ~/temp/changes.diff &" | |
free_port() { | |
kill -9 $(lsof -t -i:$1) | |
} | |
terminate() { |
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
# Stop and remove all containers | |
docker rm -f $(docker ps -a -q) | |
# Remove all images | |
docker rmi $(docker images -a -q) | |
# Remove other unused docker data, i.e. networks | |
docker system prune | |
# Remove all the unused docker volumes (frees lots of space!) |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"name": "vue-cli-service-tests", | |
"request": "launch", | |
"env": { | |
"NODE_ENV": "test" | |
}, |
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
; Maps function over list | |
; f - function of one argument, returns transformed argument | |
; l - list | |
(define (map f l) | |
(if (> (length l) 0) | |
(cons | |
(f (car l)) | |
(map f (cdr l)) | |
) | |
() |