Skip to content

Instantly share code, notes, and snippets.

View bcbcarl's full-sized avatar

Carl X. Su bcbcarl

  • Taipei City, Taiwan
View GitHub Profile
import time
j = range(100000)
def test_plus():
out = ''
for i in j:
out += 'a'
return out
import time
n = range(50000)
def test_tuple():
data = ()
for i in n:
data += (1, 2) + (3, 4)
@RJHsiao
RJHsiao / Insertion_Sort_With_Binary_Search.py
Created January 28, 2015 08:04
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)
print(
"Target Array",
searchArray,
@alphazo
alphazo / .gitignore
Last active October 12, 2015 21:39
ArchLinux Installation Guide - Encrypted SSD (GPT/GRUB2/LUKS/LVM/Systemd)
*.*~

Unionize: network superpowers for your docker containers

Unionize lets you connect together docker containers in arbitrarily complex scenarios.

Just check those examples.

LAMP stack with a private network between the MySQL and Apache containers

Let's create two containers, running the web tier and the database tier:

@timdream
timdream / 25-Heiti.conf
Last active December 19, 2015 19:29
Heiti fontconfig
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- Heiti Configure File -->
<fontconfig>
<match target="font">
<test qual="any" name="family">
<string>Heiti SC</string>
<string>黑體-簡</string>
<string>黒体-簡</string>
<string>Heiti-간체</string>
@kou1okada
kou1okada / ruby-2.0.0-p247.cygwin64.patch
Created October 29, 2013 05:25
Patch for compiling ruby-2.0.0-p247 on cygwin64
diff -cr ruby-2.0.0-p247.orig/file.c ruby-2.0.0-p247/file.c
*** ruby-2.0.0-p247.orig/file.c 2013-04-25 00:43:05.000000000 +0900
--- ruby-2.0.0-p247/file.c 2013-10-29 14:21:53.112722600 +0900
***************
*** 4181,4187 ****
#ifdef __CYGWIN__
#include <winerror.h>
- extern unsigned long __attribute__((stdcall)) GetLastError(void);
#endif

a hint for Archlinux install on SD cards

(for booting on MacBookAir)

Environment

@bezawislak
bezawislak / SomeComponent.tsx
Last active July 25, 2016 22:25
React CSSModules typings
declare module 'react-css-modules' {
interface Options {
allowMultiple?: boolean;
errorWhenNotFound?: boolean;
}
module CSSModules {
interface Props {
styles?: any;
styleName?: string;