Skip to content

Instantly share code, notes, and snippets.

View alecchen's full-sized avatar

Alec Chen alecchen

View GitHub Profile
@BenjaminPoncet
BenjaminPoncet / ffmpeg-wrapper
Last active March 29, 2024 10:11
Synology VideoStation ffmpeg wrapper with DTS, EAC3 and TrueHD support. This project is no longer maintained: Please see the following projects: https://github.com/darknebular/Wrapper_VideoStation/ - https://github.com/AlexPresso/VideoStation-FFMPEG-Patcher
#!/bin/bash
rev="12"
_log(){
echo "$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - $1" >> /tmp/ffmpeg.log
}
_log_para(){
echo "$1" | fold -w 120 | sed "s/^.*$/$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - = &/" >> /tmp/ffmpeg.log
@wancw
wancw / 0 - Readme.md
Last active July 4, 2023 09:34
移除 macOS 健保卡元件

檔案說明

  • removeNHIICC.sh : 移除健保卡元件與相關設定,須以 root (sudo) 權限執行。
  • postinstall.sh : 官方「MAC 元件移除安裝檔」的 script 內容(2020)
(function ($) {
'use strict';
// There's multiple similar tables (long and short positions).
// They have duplicate html id attributes, so we need to scope ourselves to only the long table.
let $root;
function isUnRealizedGainLossTabActive() {
const href = String(window.location.href);
return /GainLoss.aspx/i.test(href) && /gainlosstype=unrealized/i.test(href);
@organisciak
organisciak / hterm_solarized.js
Last active July 14, 2019 09:23 — forked from russelldavies/hterm_solarized.js
Solarized for Mosh Chrome
// Solarized for Mosh Chrome
// Mosh does not seem to save profiles, so this sets the default 'mosh' profile.
// To reset, evaluate term_.prefs_.resetAll()
// Run in the JavaScript console of mosh_browser.html, which can be opened
// as explained here:
// https://github.com/rpwoodbu/mosh-chrome/wiki/FAQ#how-can-i-change-the-way-the-terminal-looks-font-color-etc
var htermProfiles = {
// Solarized Dark
@xdite
xdite / url_shortner.rb
Created November 3, 2012 15:18
URL shortner
# -*- encoding : utf-8 -*-
require 'digest/md5'
module UrlShorter
ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//)
def self.short!(url)
hex = Digest::MD5.hexdigest(url)
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@moklett
moklett / openconnect.md
Created July 24, 2012 15:21
OpenConnect VPN on Mac OS X

Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.

As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
    

brew install openconnect

開源之道

Original transcript: http://allisonrandal.com/2012/04/15/open-source-enlightenment/

這幾年來,我慢慢覺得,我們參與開源社群,就像是在一條道路上並肩而行:這不僅讓我們成為更好的程式設計者,也讓我們通過與人合作,而成為更好的人。

您可以將它想成一條修行之道,讓身而為人的我們能夠不斷成長。接下來,我想談談我對開源世界的個人觀點,希望能與您分享。

首先,人是一切開源專案的核心。程式碼是很重要,但最核心的永遠是人。

@DAddYE
DAddYE / hack.sh
Created March 19, 2012 11:31
OSX For Hackers
#!/bin/sh
##
# This is a script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run in interactive mode with:
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)"
#
# or run it without prompt questions:
@wheresalice
wheresalice / gist:949611
Created April 30, 2011 11:33
Sinatra Dropbox Oauth
require 'rubygems'
require 'erb'
require 'sinatra'
require 'dropbox'
configure do
enable :sessions
end
def authed?