Skip to content

Instantly share code, notes, and snippets.

@akccakcctw
akccakcctw / create_thumbnail.sh
Last active April 11, 2017 04:13
利用 ImageMagick 產生縮圖並輸出為 .html
# version 1.1.0
# Rex Tsou
# 2017/04/11
echo -----------
echo v1.1.0
echo Author: Rex Tsou
echo -----------
echo '-h for more information'

SASS color maps

  1. Theme colors (your brand colors)
  2. UI colors (colors for errors, flashes, success buttons...)
  3. Gray colors (colors for typography, shadows, backgrounds)
  4. Brand colors (social media branded elements like Facebook, Twitter, etc.)

example:

@akccakcctw
akccakcctw / scrollToElement.js
Created August 28, 2016 15:43
卷軸平滑捲動到頁面元素
//smooth scroll to #id
var $root = $('html, body');
$('a.bookmark').click(function() {
var href = $.attr(this, 'href');
$root.animate({
scrollTop: $(href).offset().top
}, 500, function() {
window.location.hash = href;
});
return false;

Keybase proof

I hereby claim:

  • I am akccakcctw on github.
  • I am akccakcctw (https://keybase.io/akccakcctw) on keybase.
  • I have a public key whose fingerprint is 486D D002 3547 1AC6 5279 97F2 D8A1 80F0 B6DA 8CF6

To claim this, I am signing this object:

@akccakcctw
akccakcctw / checkurls.sh
Created September 29, 2016 09:58
檢查url狀態,並輸出為md檔
#!/bin/bash
# -----------------------
# |+++| version 1.0.0
# |+++| Rex Tsou
# |+++| 2016/09/29
# usage------------------
# $ ./checkurls.sh [file]
# -----------------------
echo '' >> url_status.md
echo `date` >> url_status.md
@akccakcctw
akccakcctw / imageCompress.sh
Last active January 9, 2017 10:38
利用 ImageMagick 壓縮圖片
#!/bin/bash
# version 1.3.2
# Rex Tsou
# 2017/01/09
echo --------------------
echo 圖片壓縮工具 v1.3.2
echo Author: Rex Tsou
echo --------------------
@akccakcctw
akccakcctw / checkurls.sh
Last active September 26, 2017 08:30
check URLs in a file and get HTTP status code
#!/bin/bash
# -----------------------
# |###| version 1.3.1
# |###| Rex Tsou
# |###| 2017/09/26
# usage------------------
# $ ./checkurls.sh [file]
# -----------------------
output_file='url_status.md'
@akccakcctw
akccakcctw / CSS-variable-with-support.scss
Created September 30, 2017 07:42
CSS variable mixin with @supports
$colors: (
origin: grey,
warning: orange,
danger: red
);
:root {
@each $key, $color in $colors {
--#{key}: $color;
}
/**
* A node in the DOM tree.
*
* @external Node
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node Node}
*/
/**
*
* @param {external:Node} el - Element want to scroll
@akccakcctw
akccakcctw / download_repo.sh
Created December 3, 2017 03:05
Download repo files from GitHub
# 下載 repo files 並解壓縮至資料夾
cd $HOME
mkdir <repo>
cd <repo>
curl -L https://github.com/<user>/<repo>/archive/master.tar.gz | tar -xz --strip-component=1