Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
palette="/tmp/palette.png"
filters="fps=15,scale=320:-1:flags=lanczos"
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2
import re
from queue import PriorityQueue
class Tile:
def __init__(self, blocked=False, lb="", isKey=False, isTrap=False):
self.blocked = blocked
self.lb = lb
self.isKey = isKey
self.isTrap = isTrap
@louy2
louy2 / build_stable.sh
Created January 25, 2017 12:20
OpenBSD-STABLE Automated build script: 2 Posted 12-02-2014 at 06:18 PM by rocket357 from http://www.linuxquestions.org/questions/blog/rocket357-328529/openbsd-stable-automated-build-script-2-36315/
#!/bin/sh
# OpenBSD-STABLE Automated build script: 2 Posted 12-02-2014 at 06:18 PM by rocket357
# from http://www.linuxquestions.org/questions/blog/rocket357-328529/openbsd-stable-automated-build-script-2-36315/
# Comment by louy2
# Requires root
# Default disk layout doesn't work because /usr/xenocara & /usr/xobj shares
# the 2G given to /usr
# Recommend 2G each for /usr/xenocara & /usr/xobj too
import Html exposing (..)
import Html.App as App
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
import Random
main =
App.program
{ init = init
, update = update
@louy2
louy2 / form.elm
Created September 16, 2016 10:33
Elm guide user input form, with all bonus exercises completed. https://guide.elm-lang.org/architecture/user_input/forms.html
import Html exposing (..)
import Html.App as App
import Html.Attributes exposing (..)
import Html.Events exposing (onInput, onClick)
import String
import Regex
main =
App.beginnerProgram { model = model, view = view, update = update }
// test null-terminated number
if (sscanf(string, "%d%c", &number, &dummy) == 1)
// test \n-terminated number i.e. stdin
if (sscanf(string, "%d%c", &number, &dummy) == 2 || dummy == '\n')
@louy2
louy2 / hatsukoi_special2.py
Last active June 26, 2016 11:43
Paiza POH 8 恋するハッカソン〜君色に染まるアイドル〜「水着」ゲットチャレンジ! https://paiza.jp/poh/hatsukoi/challenge/hatsukoi_special2
def needPanels(motoStr, atoStr):
panelDict = {}
motoList = list(motoStr)
for panel in motoList:
if panel in panelDict.keys():
panelDict[panel] += 1
else:
panelDict[panel] = 1
needCount = 0
atoList = list(atoStr)
@louy2
louy2 / PROMPT_COMMAND.sh
Created April 28, 2016 06:14
Sound bell on prompt. Also blinks taskbar icon on mintty Windows.
# https://www.linuxquestions.org/questions/linux-newbie-8/bell-sound-alert-on-bash-shell-giving-me-the-prompt-926299/
PROMPT_COMMAND="echo -e '\a'"
@louy2
louy2 / set_win_home.sh
Created April 27, 2016 19:27
Set MSYS2 home folder to Win user dir
# /etc/profile.d/set_win_home.sh
# Set HOME to Windows user dir
# Source: https://superuser.com/questions/809974/msys2-home-folder-show
HOME=/c/Users/$USER
cd
@louy2
louy2 / gist:3ca9f876c817a5e45288224aa69d65a7
Created April 27, 2016 13:00
Verifying that +fridsun is my blockchain ID. https://onename.com/fridsun
Verifying that +fridsun is my blockchain ID. https://onename.com/fridsun