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 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) | |
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 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 {} |
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/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)" |
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
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
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
``` | |
➜ 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 |
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
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] |
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 React from 'react' | |
export default Flying = (ChildClass) => ( | |
class extends React.Component { | |
render() { | |
<div class="flying-css-stuff"> | |
<Flying /> | |
</div> | |
} | |
} |
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
// This is my personal Surfingkeys configuration file. | |
// The two globals from Surfingkeys are `api` and `settings`. | |
const { | |
aceVimMap, | |
mapkey, | |
imap, | |
imapkey, | |
getClickableElements, |
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
### BAD WAY ### | |
class Animal | |
Animal.prototype.foo = {bar: "baz"} | |
class Dog extends Animal | |
fred = new Dog() |
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
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 |
NewerOlder