Skip to content

Instantly share code, notes, and snippets.

Avatar

Brennan Cheung brennancheung

View GitHub Profile
View edit-workflow-main.js
const chokidar = require('chokidar')
const fs = require('fs')
const winPicsPath = '/c/Users/brenn/Pictures/exports'
const picsPath = '/mnt/c/Users/brenn/Pictures/exports'
const watchPaths = {
exports: `${picsPath}`,
}
const MB = 1024 * 1024
View teleport.cs
private void TP(BasePlayer player, MapNote note)
{
player.flyhackPauseTime = 10f;
var health = player.health;
var health2 = 100 - health;
player._health = 100000;
var pos = note.worldPosition + new Vector3(0,120,0);;
player.Teleport(pos);
Message(player, "Teleported", pos);
timer.Once(6f, () => { if (player == null) return; Message(player, "Cooldown", (100 - health2)); player.SetMaxHealth(100); player.Hurt(health2); });
View settings.json
{
"workbench.sideBar.location": "left",
"editor.fontFamily": "'DejaVu Sans Mono for Powerline'",
"editor.fontSize": 14,
"editor.tabSize": 4,
"workbench.colorTheme": "Darktooth",
"editor.minimap.enabled": false,
"window.zoomLevel": 2,
"window.openFilesInNewWindow": "off",
"workbench.statusBar.visible": true,
View gist:f4507101d19b2b633a9924c315c26637
$ cargo run
Compiling k8s-controller v0.1.0 (/Users/brennan/code/rust/k8s-controller)
warning: unused import: `tokio::prelude::*`
--> src/main.rs:3:5
|
3 | use tokio::prelude::*;
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
View extract-ids-map.js
const extractIds = items => items.map(item => item.id)
View extract-ids-for.js
const extractIds = items => {
let itemIds = []
for (let i=0; i<items.length; i++) {
itemIds.push(items[i].id)
}
return itemIds
}
View useFirestoreCollectionQuery3.js
export const useFirestoreCollectionQuery = (path, renderFn) => {
const [state, setState] = useState(null)
const collection = useRef(useFirestoreCollection(path))
useEffect(() => {
console.log('useEffect')
return collection.current.onSnapshot(snapshot => {
const docs = snapshot.docs.map(x => x.data())
setState(docs)
View useFirestoreCollectionQuery1.js
export const useFirestoreCollectionQuery = (path, renderFn) => {
const [state, setState] = useState(null)
const collection = useFirestoreCollection(path)
useEffect(() => {
console.log('useEffect')
return collection.onSnapshot(snapshot => {
const docs = snapshot.docs.map(x => x.data())
setState(docs)
View useFirestoreCollectionQuery2.js
export const useFirestoreCollectionQuery = (path, renderFn) => {
const [state, setState] = useState(null)
const collection = useFirestoreCollection(path)
useEffect(() => {
console.log('useEffect')
return collection.onSnapshot(snapshot => {
const docs = snapshot.docs.map(x => x.data())
setState(docs)