Skip to content

Instantly share code, notes, and snippets.

View zetavg's full-sized avatar

Pokai Chang zetavg

View GitHub Profile
@zetavg
zetavg / smoothScrolling.coffee
Last active August 29, 2015 14:07
讓網頁中的 <a href="#foo">bar</a> 都平滑捲動。
$("a[href*=#]:not([href=#])").click ->
if location.pathname.replace(/^\//, "") is @pathname.replace(/^\//, "") and location.hostname is @hostname
target = $(@hash)
target = (if target.length then target else $("[name=#{@hash.slice(1)}]"))
if target.length
$("html, body").animate
scrollTop: target.offset().top - 18
, 1000
false
@zetavg
zetavg / Logon.md
Created September 28, 2014 20:24
logon.zsh-theme - a theme for ZSH with Powerline, Git, NVM, RVM status and responsive design

Logon

Yet another oh-my-zsh theme, based on [agnoster][1] - A Powerline-inspired theme for ZSH

Logon Responsive

README

@lucabrunox
lucabrunox / autotools.nix
Last active December 2, 2021 18:16
Nix pill 12
pkgs: attrs:
with pkgs;
let defaultAttrs = {
builder = "${bash}/bin/bash";
args = [ ./builder.sh ];
setup = ./setup.sh;
baseInputs = [ gnutar gzip gnumake gcc binutils coreutils gawk gnused gnugrep patchelf findutils ];
buildInputs = [];
system = builtins.currentSystem;
};
@JunichiIto
JunichiIto / alias_matchers.md
Last active September 5, 2025 14:24
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@dwchiang
dwchiang / .zshrc
Created April 16, 2014 10:30
gcloud with zsh
# The next line updates PATH for the Google Cloud SDK.
source /Users/dwchiang/google-cloud-sdk/path.zsh.inc
# The next line enables zsh completion for gcloud.
source /Users/dwchiang/google-cloud-sdk/completion.zsh.inc
# The Active Admin equivalent of putting this in your application layout:
# <head>
# <%= cloudinary_js_config %>
# </head>
module ActiveAdmin
module Views
module Pages
class Base < Arbre::HTML::Document
# How to install `ipkg` on a Synology DS214
After a couple of days of trying to get `ipkg` woking on my DS214 I found [this article](https://github.com/trepmag/ds213j-optware-bootstrap) by [trepmag](https://github.com/trepmag). It is written for the DS213j, but it’s been working for me and [others](https://github.com/alberthild) for the DS214 too.
I have done some minor changed to clarify some things, but if you are a Linux guy (unlike me) my changes might be of no use to you.
## Guide
@swrobel
swrobel / 1-OpsWorksPapertrail.md
Last active August 5, 2021 20:41
Send OpsWorks log files to Papertrail using the remote_syslog gem
  1. Add remote_syslog to your Gemfile
  2. Add papertrail.rake to lib/tasks
  3. Add remote_syslog.yml to config/
  4. Add before_restart.rb to deploy/
  5. Set the PAPERTRAIL_PORT ENV var to the one provided by Papertrail for your system

Inspiration from Scott W. Bradley

/* --------------------------------
* NTUST 學生資訊系統 平均 GPA 計算
*
* 作者:Eric Ping
* 更新:Jeremy Yen
*
* Change Log
* - 修正「二次退選」所造成之問題
* - 增加 B99 百分制成績支援
* - 使用正規表達式判斷中文與數字
@Flamefork
Flamefork / React.addons.tagHelper.js
Last active January 4, 2016 00:08
React addon for easier React.DOM building without JSX
//
// React addon for easier React.DOM building without JSX
//
// Usage:
//
// render: function () {
// return React.addons.tagHelper(
// ['#main.container',
// ['h1', 'Hello!'],
// ['a.andClass.andAnother', { href: '/' }, 'Home']]