Skip to content

Instantly share code, notes, and snippets.

Carl X. Su bcbcarl

  • Taipei City, Taiwan
Block or report user

Report or block bcbcarl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Functional Vue Architecture

Sam Xiao, Feb.18, 2019

Web 所面臨的挑戰

後端 MVC

約在 2015 年,主流的 Web 開發架構仍以後端 MVC 為主:

JoniJnm / date-fns-date-adapter.ts
Created Jan 4, 2019
date-fns angular material adapter
View date-fns-date-adapter.ts
import {Injectable} from '@angular/core';
import {DateAdapter} from '@angular/material';
import {addDays, addMonths, addYears, format, getDate, getDaysInMonth, getMonth, getYear, parse, setDay, setMonth, toDate} from 'date-fns';
// CONFIG. Use environment or something for a dynamic locale and settings
import {es as locale} from 'date-fns/locale';
const WEEK_STARTS_ON = 1; // 0 sunday, 1 monday...
export const MAT_DATE_FNS_DATE_FORMATS = {
gund /
Last active Feb 15, 2020
Simple Angular mask directive

Simple Angular mask directive

This directive does not create it's own value accessor - it simply reuses whatever element is using already and just hooks in.

Also it is fully abstracted off of the HTML implementation and so can be safely used in WebWorker and server side environment.


View secret-es.mdown
jherax / is-private-mode.js
Last active Feb 22, 2020
Detect if the browser is running in Private mode (Promise based)
View is-private-mode.js
* Lightweight script to detect whether the browser is running in Private mode.
* @returns {Promise<boolean>}
* Live demo:
* @see
* This snippet uses Promises. If you want to run it in old browsers, polyfill it:
* @see
bezawislak / SomeComponent.tsx
Last active Jul 25, 2016
React CSSModules typings
View SomeComponent.tsx
declare module 'react-css-modules' {
interface Options {
allowMultiple?: boolean;
errorWhenNotFound?: boolean;
module CSSModules {
interface Props {
styles?: any;
styleName?: string;
scottsb /
Last active Jan 31, 2020 — forked from Hais/
Create and manage a case-sensitive disk-image on macOS (OS X).
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
RJHsiao /
Created Jan 28, 2015
Insertion Sort With Binary Search
#! /usr/bin/env python3
import random
def BinarySearchInsertPoint(searchArray, searchKey):
if len(searchArray) == 0:
return 0
middleIndex = int(len(searchArray) / 2 - 0.5)
"Target Array",
import time
n = range(50000)
def test_tuple():
data = ()
for i in n:
data += (1, 2) + (3, 4)
import time
j = range(100000)
def test_plus():
out = ''
for i in j:
out += 'a'
return out
You can’t perform that action at this time.