Skip to content

Instantly share code, notes, and snippets.

View veryeasily's full-sized avatar
🦌

lju veryeasily

🦌
  • Portland
  • 21:27 (UTC -08:00)
View GitHub Profile
import openai
import urllib.parse
import peewee as pw
from flask import Flask, request
from .local_env import LocalEnv
TOTAL_MESSAGES = 10
db = pw.SqliteDatabase(LocalEnv.DATABASE_URL)
@veryeasily
veryeasily / list_all_bindkey_mappings.sh
Created November 19, 2021 06:23
[Zsh Snippets] #Zsh #Shell
#!/usr/bin/env zsh
# List all bindkey mappings
#
# @see https://neg-serg.github.io/2017/03/zargs-howto/
autoload -U zargs
zargs -i{} $(bindkey -l) -- bindkey -L -M {}
@veryeasily
veryeasily / get_script_dir.sh
Last active November 18, 2021 09:10
[Get dir of current script] Gets the directory of the currently running script without getting tricked by symlinks #Shell #Zsh #Bash
#!/usr/local/bin/zsh
# @description Gets the physical location of the current script in a way that
# doesn't get tricked by symlinks
# @see https://stackoverflow.com/questions/59895/how-can-i-get-the-source-directory-of-a-bash-script-from-within-the-script-itsel
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
# next works for sourced files
# @see https://unix.stackexchange.com/a/4673/37091
SCRIPT_DIR="$(cd -- "$(dirname -- "$_")" &> /dev/null && pwd)"
@veryeasily
veryeasily / karabiner.json
Created July 23, 2021 18:05
karabiner.json
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
```
➜ Liver git:(master✘!?) mono Jenny/Jenny.exe -v gen
Loading assemblies from /Users/lukeunderwood/NewUnity/Liver/Jenny
Jenny.exe load: /Users/lukeunderwood/NewUnity/Liver/Jenny/DesperateDevs.Utils.dll
➜ Loading: /Users/lukeunderwood/NewUnity/Liver/Jenny/DesperateDevs.Utils.dll
Jenny.exe load: /Users/lukeunderwood/NewUnity/Liver/Jenny/DesperateDevs.Logging.dll
➜ Loading: /Users/lukeunderwood/NewUnity/Liver/Jenny/DesperateDevs.Logging.dll
Jenny.exe load: /Users/lukeunderwood/NewUnity/Liver/Jenny/DesperateDevs.CodeGeneration.dll
➜ Loading: /Users/lukeunderwood/NewUnity/Liver/Jenny/DesperateDevs.CodeGeneration.dll
Jenny.exe load: /Users/lukeunderwood/NewUnity/Liver/Jenny/DesperateDevs.CodeGeneration.CodeGenerator.dll
from flask import Flask
from textgenrnn import textgenrnn
app = Flask(__name__)
@app.route('/<text>')
def hello(text):
textgen = textgenrnn()
return textgen.generate(prefix=text,return_as_list=True)[0]
import React from 'react'
export default Flying = (ChildClass) => (
class extends React.Component {
render() {
<div class="flying-css-stuff">
<Flying />
</div>
}
}
@veryeasily
veryeasily / surfingkeys.config.js
Last active November 9, 2024 05:46
SurfingKeys Config #JavaScript #SurfingKeys
// This is my personal Surfingkeys configuration file.
// The two globals from Surfingkeys are `api` and `settings`.
const {
aceVimMap,
mapkey,
imap,
imapkey,
getClickableElements,
@veryeasily
veryeasily / scary-thing.coffee
Created March 5, 2014 17:35
Never modify properties of object pointers on your prototype in javascript, or you break things higher up in the chain. I also show a good workaround
### BAD WAY ###
class Animal
Animal.prototype.foo = {bar: "baz"}
class Dog extends Animal
fred = new Dog()
STOREFRONT=~/rtr/rtr_ruby_storefront
cd ${STOREFRONT}/public/images
for i in $(ls); do
pushd .
cd ../..
ack-grep -l "\/public\/images\/$i" > tempfile
cat tempfile
for file in $(< tempfile); do
sed "s/\/public\/images\/${i}/\/images\/${i}/g" "$file" > ${file}.bak