Skip to content

Instantly share code, notes, and snippets.

View taichunmin's full-sized avatar

戴均民 taichunmin

View GitHub Profile
@taichunmin
taichunmin / README.md
Last active September 23, 2025 07:10
瀏覽器書籤 JS 大補帖

瀏覽器書籤 JS 大補帖

使用方法:新增一個書籤,把底下 javascript: ... 的程式貼到書籤的網址內,然後去你想要用的網頁,點一下書籤就會載入這些 JS 進來,你可以自己修改想要載入的 JS 清單。

javascript: (async () => { const loadScript = async url => new Promise((resolve, reject) => { const script = document.createElement('script'); script.src = url; script.onload = () => resolve(); script.onerror = () => reject(new Error(`Failed to load script: ${url}`)); document.head.appendChild(script); }); console.log(`js-snippets.js started`); const LIBRARIES_URL = 'https://gist.githubusercontent.com/taichunmin/5171d5c7de23d8270c1f03be75593713/raw/libraries.json'; const libraries = await (await fetch(`${LIBRARIES_URL}?t=${Date.now()}`)).json(); await Promise.all(libraries.map(loadScript)); const dayjsPlugins = _.chain(_.keys(window)).filter(k => _.startsWith(k, 'dayjs_plugin_')).value(); console.log(`found ${dayjsPlugins.length} plugins of dayjs`); for (const plugin of dayjsPlugins) window.dayjs.extend(window[plugin]); })()
建立一個新的 Provider
<?php
namespace App\Providers;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\ServiceProvider;
apt-get install build-essential libtool libusb-dev libusb-1.0 gcc make autoconf pkg-config libudev-dev flex pcsc-tools libpcsclite-dev
#download pcsc lite
wget https://alioth.debian.org/frs/download.php/file/4225/pcsc-lite-1.8.22.tar.bz2
tar xvf pcsc-lite*.tar.bz2
cd pcsc*
@voodeng
voodeng / css_resources.md
Created May 31, 2014 09:15 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@voodeng
voodeng / python_resources.md
Created May 31, 2014 09:15 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@hwdsl2
hwdsl2 / .MOVED.md
Last active September 2, 2025 05:41
IPsec VPN Server Auto Setup Script for Ubuntu and Debian
@ufologist
ufologist / CryptoJS-DES.html
Created May 15, 2013 03:34
Use CryptoJS encrypt message by DES and direct decrypt ciphertext, compatible with Java Cipher.getInstance("DES")
<!-- test pass with CryptoJS v3.1.2 -->
<script src="rollups/tripledes.js"></script>
<script src="components/mode-ecb.js"></script>
<script>
/**
* Encrypt message by DES in ECB mode and Pkcs7 padding scheme
*
* NOTE: DES is weak, please use 3DES(Triple DES) or AES
*
* @param {String} message

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@Thinkscape
Thinkscape / isAssocArrayBench.php
Created March 3, 2012 11:35
A benchmark of several methods for checking if PHP array is associative
<?php
if(!isset($argv[1])){
echo "Usage: ".$argv[0]." (number of iterations)\n";
exit(1);
}
/**
* Arrays to check
*/
$tests = array(