Skip to content

Instantly share code, notes, and snippets.

View FlandreDaisuki's full-sized avatar
🌈
世界にバグは不要です

Chun-Hao Lien FlandreDaisuki

🌈
世界にバグは不要です
View GitHub Profile
@FlandreDaisuki
FlandreDaisuki / gfile.md
Last active August 29, 2015 14:03
Gist Markdown Cheat Sheet

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one

@FlandreDaisuki
FlandreDaisuki / embed_script.js
Created December 26, 2015 16:33 — forked from stu43005/embed_script.js
Pixiv動態圖錄製,完成後在原圖下方會出現gif圖
(function(file){
var script=document.createElement('script');
script.type='text/javascript';
script.src=file;
document.body.appendChild(script);
})("https://rawgit.com/stu43005/49ff25325b357053b8e9/raw/pixiv_gif_encoder.js");
/*
網址列(或書籤)用:
javascript:(function(file){var script=document.createElement('script');script.type='text/javascript';script.src=file;document.body.appendChild(script)})("https://rawgit.com/stu43005/49ff25325b357053b8e9/raw/pixiv_gif_encoder.js")
@FlandreDaisuki
FlandreDaisuki / GaussianSharpen.m
Created December 29, 2015 08:58 — forked from tony01111299/GaussianSharpen.m
Gaussian sharpen
function [O, invFG] = GaussianSharpen(M, sigma, lambda)
F = fft2(M);
G = fgaussian(size(M), sigma);
FG = fft2(G);
invFG = FG./(lambda + FG.^2);
% invFG = invFG/max(max(abs(invFG)));
F2 = F.*invFG;
O = fftshift(ifft2(F2));
end
@FlandreDaisuki
FlandreDaisuki / webworker-preloader.html
Created January 7, 2016 18:38 — forked from mseeley/webworker-preloader.html
WebWorker Image preloader proof of concept (Tested in Mobile Safari 6.0/IOS 6.1.3 and Chrome 33)
<!DOCTYPE html>
<html>
<head>
<title>WebWorker image preloading</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
</head>
<body>
<div id="output"></div>
<script id="imgloader" type="javascript/worker">
// Not race proof or robust. Proof of concept.
@FlandreDaisuki
FlandreDaisuki / docker-web-app.md
Created January 25, 2016 17:44 — forked from kevingo/docker-web-app.md
Dockerizing a Node.js web app

Dockerizing a Node.js web app

如果想要在 Docker 在跑 NodeJS 的應用,可以參考 NodeJS 官網上有一篇 「Dockerizing a Node.js web app」介紹,還蠻簡單易懂的,這邊稍微紀錄一下相關步驟。

建立 package.json

{
  "name": "docker_web_app",
  "version": "1.0.0",
FROM ubuntu:14.04
RUN apt-get update && \
apt-get install -y \
build-essential \
cmake \
git \
wget \
unzip \
pkg-config \
@FlandreDaisuki
FlandreDaisuki / index.js
Created November 10, 2016 07:20 — forked from edokeh/index.js
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@FlandreDaisuki
FlandreDaisuki / GM_download_polyfill.js
Created February 18, 2017 02:32 — forked from ccloli/GM_download_polyfill.js
GM_download polyfill, a polyfill to make your userscript supports GM_download
/*
* GM_download polyfill
*
* @description A polyfill to make your userscript supports GM_download
* @author ccloli
* @version 1.0
*/
// to use this polyfill, you must add "@grant GM_xmlhttpRequest" at userscript metadata block
@FlandreDaisuki
FlandreDaisuki / dom_load_order.user.js
Created October 22, 2017 10:48 — forked from ipcjs/dom_load_order.user.js
Dom相关事件的执行顺序
// ==UserScript==
// @name New Userscript
// @namespace https://github.com/ipcjs
// @version 0.0.1
// @description try to take over the world!
// @author ipcjs
// @match http://bangumi.bilibili.com/anime/5788/play*
// @grant none
// @run-at document-start
// ==/UserScript==
@FlandreDaisuki
FlandreDaisuki / cs.py
Created January 18, 2018 10:16 — forked from myano/cs.py
Quick example of ncurses in Python!
#!/usr/bin/env python
import curses
import curses.textpad
import time
stdscr = curses.initscr()
#curses.noecho()
#curses.echo()