Skip to content

Instantly share code, notes, and snippets.

View chuyihuang's full-sized avatar

Bamboo Huang chuyihuang

View GitHub Profile
@chuyihuang
chuyihuang / gist:dec34b2fdf9e1f39abb8
Created November 25, 2015 17:36
docker建立mysql的data only container,存放資料庫避免container移除時資料遺失
#使用busybox做為container的image
#執行以下:
docker run -v /var/lib/mysql --name app_data busybox
# -v掛載/var/li/mysql路徑的資料,並在busybox上建立一個名為app_data的container
# 透過docker ps-a 觀察建立結果,結果是exit,這是正常結果,因為只是做掛載實體檔案的動作
#串聯管理mysql的container:
docker run -P --volumes-from app_data --name mysql -e MYSQL_ROOT_PASSWORD=aabbcc -d -t mysql:latest
#-P 表示開放全部的連接阜給其他container,並且透過--volumes-from掛載路徑資料的container,然後帶入環境參數,aabbcc只是舉例。
# 完成後用docker ps -a檢查是否正確執行
@chuyihuang
chuyihuang / Ubuntu 10.10 source.list
Created June 21, 2013 07:24
Ubuntu no longer support v.10.10, the following scripts might be helpful...
## Major bug fix updates produced after the final release of the
## distribution.
deb http://old-releases.ubuntu.com/ubuntu/ maverick main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick main restricted
deb http://old-releases.ubuntu.com/ubuntu/ maverick-updates main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
@chuyihuang
chuyihuang / .js
Last active April 9, 2016 03:23
webpack babel example
module.exports = {
entry: "./app.js",
output: {
filename: "./bundle.js"
},
module: {
loaders: [
{
test: /jsx?$/,
exclude: /node_modules/,
@chuyihuang
chuyihuang / react-native-network-request-fail.md
Last active August 23, 2016 09:19
處理react native network request fail的問題

參考: http://10minbasics.com/react-native-network-request-failed-fix/

First of all, when you try to use the network in your app, you should enable it in XCode.

  1. Click on your project in the Project Navigator
  2. Open the Info tab (打開info.plist檔案)
  3. Right click on App Transport Security Settings and select Add Row
  4. For created row set the key “Allow Arbitrary Loads“, type to boolean and value to YES.
@chuyihuang
chuyihuang / main.js
Created August 26, 2016 09:13
invalid_auth when connecting to eventbrite
// https://www.eventbriteapi.com/v3/users/me/?token=SESXYS4X3FJ5LHZRWGKQ
import React, { Component } from 'react';
import {
View,
Text,
StyleSheet
} from 'react-native';
const API_KEY = 'Bearer SESXYS4X3FJ5LHZRWGKQ';
@chuyihuang
chuyihuang / order.xls
Created August 30, 2016 10:05
order.xls example
<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<Worksheet ss:Name="Sheet1">
<Table>
<Row>
<Cell><Data ss:Type="String">建立時間</Data></Cell>
@chuyihuang
chuyihuang / gist:07bb9072ea75cdf36148af7463a48f6b
Created September 26, 2016 07:27
mac安裝mongodb後自動啟動 | mongodb auto start after installation
1. 用brew install mongoldb
2. 安裝完畢後用ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents 連結
3. 加入自動launch清單 launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
4. 如果都無法啟動的話,可能要檢查log資料夾的權限: /usr/local/var/log/mongodb 改成使用者的
chown -R username mongodb
5. 以及chgrp:
chgrp -R groupname mongodb
@chuyihuang
chuyihuang / gist:9678ef573dd4a8688b6e56a5667b76a3
Created September 30, 2016 04:15
徹底移除atom的指令清單 completely remove atom from your MAC
rm -rf ~/.atom
rm -rf /usr/local/bin/atom
rm -rf /usr/local/bin/apm
rm -rf /Applications/Atom.app
rm -rf ~/Library/Preferences/com.github.atom.plist
rm -rf ~/Library/Application Support/com.github.atom.ShipIt
rm -rf ~/Library/Application Support/Atom
rm -rf ~/Library/Saved Application State/com.github.atom.savedState
rm -rf ~/Library/Caches/com.github.atom
rm -rf ~/Library/Caches/Atom