Skip to content

Instantly share code, notes, and snippets.

Yufan Lou louy2

Block or report user

Report or block louy2

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gifenc.sh
#!/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
View dungeon.py
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 Jan 25, 2017
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/
View build_stable.sh
#!/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
View random.elm
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 Sep 16, 2016
Elm guide user input form, with all bonus exercises completed. https://guide.elm-lang.org/architecture/user_input/forms.html
View form.elm
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 }
View reject.c
// 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 Jun 26, 2016
Paiza POH 8 恋するハッカソン〜君色に染まるアイドル〜「水着」ゲットチャレンジ! https://paiza.jp/poh/hatsukoi/challenge/hatsukoi_special2
View hatsukoi_special2.py
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 Apr 28, 2016
Sound bell on prompt. Also blinks taskbar icon on mintty Windows.
View PROMPT_COMMAND.sh
# 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 Apr 27, 2016
Set MSYS2 home folder to Win user dir
View set_win_home.sh
# /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
View gist:3ca9f876c817a5e45288224aa69d65a7
Verifying that +fridsun is my blockchain ID. https://onename.com/fridsun
You can’t perform that action at this time.