Skip to content

Instantly share code, notes, and snippets.

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

Chun-Hao Lien FlandreDaisuki

🌈
世界にバグは不要です
View GitHub Profile

pipe

ls | grep xxx equal to dir | find xxx

diff

diff f1 f2 equal to FC f1 f2

#!/usr/bin/python
# This is a simple port-forward / proxy, written using only the default python
# library. If you want to make a suggestion or fix something you can contact-me
# at voorloop_at_gmail.com
# Distributed over IDC(I Don't Care) license
import socket
import select
import time
import sys
@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",
@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 / 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 / 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")
{
"snippets": {
"variables": {
"lang": "zh-Hant-TW",
"locale": "zh-TW",
"charset": "UTF-8",
"indentation": "\t",
"newline": "\n"
},
@FlandreDaisuki
FlandreDaisuki / ordered-fetch-promise.js
Created September 16, 2015 18:49
Thanks dannvix senpai
import fetch from "/Users/dannvix/node_modules/node-fetch";
import Promise from "/Users/dannvix/node_modules/promise";
const urls = [
"http://www.google.com",
"http://www.yahoo.com",
"http://www.microsoft.com",
];
(function fetchUrl(urlIdx) {
#include <GL/glut.h>
#include <cstdio>
#include <cmath>
GLfloat rot = 0.0;
GLfloat PI = (GLfloat)3.14159265;
GLfloat seed_2 = 0.0;
enum EXAMPLE{ NORMAL, ROTATE, TRANSLATE, SCALE };
EXAMPLE mode = SCALE;
// ==UserScript==
// @name Flanico
// @namespace FlandreDaisuki
// @description A HTML5 based niconico player
// @include http://www.nicovideo.jp/watch/*
// @match http://www.nicovideo.jp/watch/*
// @exclude
// @version 2015.07.14
// @grant none
// ==/UserScript==