// kotlin
fun greetUser(name: String = "World"): String {
return "Hello ${name}!"
}
fun main(args: Array<String>) {
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/sh | |
| # bash script for exporting subscriber data from stripe, using the stripe cli: | |
| # https://docs.stripe.com/stripe-cli | |
| # make sure you sign in first: | |
| # https://docs.stripe.com/stripe-cli/install#login-account | |
| echo "id,name,shipping.name,shipping.address.city,shipping.address.country,shipping.address.line1,shipping.address.line2,shipping.address.postal_code,shipping.address.state,subscriptions.count,subscriptions.status,subscriptions.plan.product" | |
| STARTING_AFTER="" |
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 Database, { Statement, Options } from "better-sqlite3"; | |
| import { Request, Response } from "node-fetch"; | |
| interface Record { | |
| url: string; | |
| status: number; | |
| statusText: string; | |
| body: Buffer; | |
| headers: string; | |
| insertTime: number; |
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
| // based on this awesome script | |
| // https://gist.github.com/saranrapjs/f8700e33332ae4a13a931e761fc262a7 | |
| (function check() { | |
| // they have hijacked document.querySelector/getElementById/etc but not document.all | |
| Array.from(document.all).filter(el => el.nodeName.toLowerCase() === 'lightning-button-icon')[0].click(); | |
| setTimeout(() => { | |
| Array.from(document.all).filter(el => el.name === 'today')[0].click(); | |
| setTimeout(() => { | |
| const txt = Array.from(document.all).filter(el => el.className === 'appointment-section')[0].textContent; |
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
| local util = import 'util.jsonnet'; | |
| local test = import 'test.jsonnet'; | |
| local build_css = { | |
| image: 'node-image', | |
| name: 'build-css', | |
| depends_on: util.depends_on([test.lint_css, test.lint_script, test.test_js]), | |
| commands: [] // etc | |
| }; |
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
| /* | |
| !!!!! | |
| USE THIS TOOL INSTEAD: | |
| https://github.com/coolov/svgum | |
| !!!! | |
| If you use https://app.diagrams.net/ with google webfonts and export to svg and then |
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 | |
| # Liquid Soap Install Script | |
| # https://www.liquidsoap.info/ | |
| brew update | |
| brew install opam | |
| # based on | |
| # https://github.com/savonet/liquidsoap/blob/master/doc/content/install.md#install-using-opam |
there are 5 types: identifier, keyword, punctuation, literal, or operator
- A keyword is a word that is reserved because the word has a special meaning, for example: class, enum, function.
- An identifier is a symbol which names a language entitiy, for example a variable, type, label, subroutine, or package
- Punctuation (, ), {, }, [, ], ., ,, :, ;, =, @, #, &
- A literal is the source code representation of a value of a type, such as a number or string
- An operator is a symbol that tell the compiler to perform specific mathematical or logical manipulations
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 util = require("util"); | |
| const http = require("http"); | |
| const path = require("path"); | |
| const stat = util.promisify(fs.stat); | |
| const port = 8080; | |
| const rootDir = path.join(__dirname, "public"); | |
| const mimeTypes = { |
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
| /* | |
| mnmlst fetch implementation for node | |
| list of options: | |
| https://nodejs.org/api/http.html#http_http_request_url_options_callback | |
| example: | |
| ``` | |
| let { body } = await get('https://dog.ceo/api/breeds/image/random'); | |
| let data = JSON.parse(body); | |
| ``` |
NewerOlder