Skip to content

Instantly share code, notes, and snippets.

View brennancheung's full-sized avatar

Brennan Cheung brennancheung

View GitHub Profile
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
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); });
{
"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,
$ 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
const extractIds = pluck('id')
const extractIds = items => items.map(item => item.id)
const extractIds = items => {
let itemIds = []
for (let i=0; i<items.length; i++) {
itemIds.push(items[i].id)
}
return itemIds
}
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)
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)
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)