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 curses | |
import numpy as np | |
import random | |
from enum import Enum | |
from typing import Any, List, Tuple, Callable | |
import time | |
MAP_WIDTH = 80 | |
MAP_HEIGHT = 25 |
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 curses | |
import numpy as np | |
import random | |
from enum import Enum | |
from typing import Any, List, Tuple, Callable | |
import time | |
MAP_WIDTH = 80 | |
MAP_HEIGHT = 25 |
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 curses | |
import numpy as np | |
import random | |
from enum import IntEnum | |
from typing import Any, List, Tuple, Callable | |
import time | |
import profile | |
MAP_WIDTH = 100 | |
MAP_HEIGHT = 100 |
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
Character Aurora Li is a 28 y.o. Female: | |
Was born WITHOUT CONVICTIONS, but CONSERVATIVE was his/her true nature | |
Profession: Civilian | |
He/She has 458 juice and is therefore considered an Urban Commando by society. | |
Attributes: | |
hp=4 | |
heart=1 | |
wisdom=4 | |
intel=9 | |
strength=4 |
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 math import cos, sin, pi | |
from enum import IntFlag | |
import numpy as np | |
# OUTPUT : | |
# | |
# Walkable space : | |
# [[ True True True True True] | |
# [ True False False False True] | |
# [ True False False False True] |
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 tcod | |
import tcod.event | |
def main(): | |
width = 60 | |
height = 40 | |
font = "data/fonts/dejavu16x16_gs_tc.png" | |
flag = tcod.FONT_LAYOUT_TCOD | tcod.FONT_TYPE_GREYSCALE | |
tcod.console_set_custom_font(font, flag) |
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
CREATE TABLE purchases_more ( | |
id serial | |
, customer_id int -- REFERENCES customer | |
, total int -- could be amount of money in Cent | |
, some_column text -- to make the row bigger, more realistic | |
); | |
INSERT INTO purchases_more (customer_id, total, some_column) -- insert 8M rows | |
SELECT (random() * 40000)::int AS customer_id -- 40k customers |
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
#!/bin/bash | |
# simple script to preview files with the help of fzf | |
cwd=$(pwd) | |
# set up | |
nvr --nostart -cc 'let nvrp_buffer=""' | |
set_variables='mime_list=( "application/json" "text/" ); mime=$(file --mime-type {} | cut -d " " -f 2)' | |
f_is_text='for m in ${mime_list[@]}; do test "${mime#$m}" != "$mime" && break || false; done' |
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
#!/bin/bash | |
# A simple script to make fzf a fuzzy-file explorer | |
cur_folder=$(pwd) | |
while true | |
do | |
folder=$( ( echo -e '.\n..'; fd -t d --color=always ) \ | |
| fzf --no-height --preview-window=right:50% \ | |
--preview 'tree -L 2 -C {}') | |
test $? -ne 0 && break |
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
#!/bin/bash | |
# A simple script to make fzf a fuzzy-file explorer | |
old_folder=$(pwd) | |
cur_folder="$old_folder" | |
while true | |
do | |
ret=$(fd -t d --color=always \ | |
| fzf --no-height \ | |
--bind 'ctrl-h:abort+execute(echo "ACTION=LEFT")','ctrl-l:abort+execute(echo "ACTION=RIGHT" {})','alt-enter:abort+execute(echo "ACTION=EXIT" {})' \ |
OlderNewer