Skip to content

Instantly share code, notes, and snippets.

View livibetter's full-sized avatar

Yu-Jie Lin livibetter

View GitHub Profile
@livibetter
livibetter / README.md
Last active June 20, 2018 04:38
Getting IP address
@livibetter
livibetter / nFlood.txt
Created January 23, 2014 05:00
for nFlood
while read font; do echo "$font"; figlet -f "$font" "nFlood"; done < <(figlist) > nFlood.txt
Default font: standard
Font directory: /usr/share/figlet
Figlet fonts in this directory:
1943____
### # # ### ### #### ### # # ### # #
### # # ## ## #### ### # # ### # #
### # # ## #### ### # # ### # #
### # # ## ## # ### # # ### # # # ##
@livibetter
livibetter / README.md
Last active June 29, 2021 22:07
ipv4grid.sh: IPv4 address in grid in terminal

ipv4grid.sh

animated GIF

Read my blog about why I made this, you can also watch a video, minute by minute.

@livibetter
livibetter / 0001.sh
Last active December 28, 2015 18:29
My solutions to Project Euler
#!/bin/bash
# Written by Yu-Jie Lin, 325311th
# https://gist.github.com/livibetter/7543115
N=$((${1:-1000} - 1))
# Method A
SUM3=0 ; ((N >= 3)) && SUM3=$(eval echo {3..$N..3})
SUM5=0 ; ((N >= 5)) && SUM5=$(eval echo {5..$N..5})
@livibetter
livibetter / README.md
Last active December 28, 2015 15:39
Lengthen URL using LongURL

lu.sh: Lengthen URL using LongURL

This is a simple Bash script wrapping around LongURL API.

Usage

@livibetter
livibetter / README.md
Last active January 17, 2021 23:55
Better YouTube recommendation and more

Better YouTube Recommendation

yt-reco.py was written to filter recommendation and prevent repeatedly seeing the same videos. Once a video is showed, the video ID is stored in a JSON for look-up in next invocation.

example HTML

installation

@livibetter
livibetter / COPYING
Last active December 27, 2015 18:39
Star Wars'd text
Copyright (c) 2013 Yu-Jie Lin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@livibetter
livibetter / messup-fixed-a.py
Created November 8, 2013 03:39
autopep8 test
import sys
import os
from something import a, b, c
print('''this will be a freaking long multi-line text string, let\'s see how autopep8 will do with it.
What else?''')
if True:
#
@livibetter
livibetter / paper.py
Last active December 27, 2015 08:49 — forked from bradmontgomery/paper.py
#!/usr/bin/env python
"""
Folding paper in half 50 times is 3/4 of the distance from earth to sun
From:
http://www.quora.com/What-are-some-of-the-most-mind-blowing-facts#answer_526501
Thickness of a sheet of paper: 0.1 mm (~0.004 inches)
@livibetter
livibetter / .gitignore
Last active December 27, 2015 07:19
Dumping YouTube video information
yt.dat