Discover gists
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
class Node { | |
constructor (value) { | |
this.value = value | |
this.right = null | |
this.left = null | |
} | |
} | |
class Tree { | |
constructor () { |
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
#!/usr/bin/env bash | |
# checck if pidof exists | |
PIDOF="$(which pidof)" | |
# and if not - install it | |
(test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof | |
# find app in default paths | |
CO_PWD=~/Applications/CrossOver.app/Contents/MacOS | |
test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS |
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 { Directive, OnDestroy } from "@angular/core"; | |
import { Subject } from "rxjs"; | |
import { takeUntil } from "rxjs/operators"; | |
@Directive() // Needed only for Angular v9+ strict mode that enforce decorator to enable Component inheritance | |
export abstract class BaseComponent implements OnDestroy { | |
// _destroy$ is LAZY: it'll be created (and allocate memory) only if you use takeUntilDestroy | |
private _destroy$?: Subject<void>; | |
protected takeUntilDestroy = <T>() => { | |
if (!this._destroy$) this._destroy$ = new Subject<void>(); // LAZY Subject |
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
/* | |
* SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD | |
* SPDX-License-Identifier: MIT | |
* M5Stack LLM Module で日本語対話。Serial MonitorでBoth BL&CRを設定するとよいです。 | |
*/ | |
#include <Arduino.h> | |
#include <M5Unified.h> | |
#include <M5ModuleLLM.h> | |
M5ModuleLLM module_llm; |
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 turtle | |
import math | |
def mandelbrot(z , c , n=20): | |
if abs(z) > 10 ** 12: | |
return float("nan") | |
elif n > 0: | |
return mandelbrot(z ** 2 + c, c, n - 1) | |
else: | |
return z ** 2 + c |
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
# Add a scheduled sync task at 4:00 am | |
# Some privileges should be granted to `cron` *manually*, so you may test `* * * * *` (run every second) first to grant the needed privileges in advance | |
0 4 * * * osascript /path/to/your/sync-from-chrome-to-safari.scpt |
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
source "https://rubygems.org" | |
gem "httparty" | |
gem "geocoder" | |
gem "slack-poster" |
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 JSForce, { Connection } from "jsforce"; | |
import dotenv from "dotenv"; | |
import fs from "node:fs"; | |
import pLimit from "p-limit"; | |
dotenv.config(); | |
const connection: Connection = new JSForce.Connection(); | |
const download = async () => { | |
// Ensure the statements directory exists to push files into during downloading. |
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
$sals1 = array("Beloved", "Darling", "Dear", "Dearest", "Fanciful", "Honey"); | |
$sals2 = array("Chickpea", "Dear", "Duck", "Jewel", "Love", "Moppet", "Sweetheart"); | |
$adjs = array("affectionate", "amorous", "anxious", "avid", "beautiful", "breathless", "burning", "covetous", "craving", "curious", "eager", "fervent", "fondest", "loveable", "lovesick", "loving", "passionate", "precious", "seductive", "sweet", "sympathetic", "tender", "unsatisfied", "winning", "wistful"); | |
$nouns = array("adoration", "affection", "ambition", "appetite", "ardour", "being", "burning", "charm", "craving", "desire", "devotion", "eagerness", "enchantment", "enthusiasm", "fancy", "fellow feeling", "fervour", "fondness", "heart", "hunger", "infatuation", "little liking", "longing", "love", "lust", "passion", "rapture", "sympathy", "thirst", "wish", "yearning"); | |
$advs = array("affectionately", "ardently", "anxiously", "beautifully", "burningly", "covetously", "curiously", "eagerly", "fervently", "fondly", "impatiently", "keenly", "lovingly" |
NewerOlder