Skip to content

Instantly share code, notes, and snippets.

View TheWaWaR's full-sized avatar
🌀
Focusing

LingFeng TheWaWaR

🌀
Focusing
View GitHub Profile
@TheWaWaR
TheWaWaR / arch_install.sh
Last active December 10, 2015 01:48 — forked from anonymous/arch_install
Arch install Script
passwd
systemctl enable sshd.service
systemctl start sshd.service
parted -s /dev/sda mklabel gpt
parted -s /dev/sda mkpart "primary" "fat16" "50MB" "60MB"
parted -s /dev/sda mkpart "primary" "ext4" "1%" "99%"
parted -s /dev/sda set 1 bios_grub on
mkfs.ext4 /dev/sda2
@TheWaWaR
TheWaWaR / iOS-Getting-Started.md
Last active December 15, 2015 20:28
iOS官方起步教程阅读笔记

马上着手开发 iOS 应用程序

  • 创建: [2013-3-15, 10:00]

A. 介绍

你将学到

  1. Objective-C 基础知识
  2. 创建一个简单的App并进行测试
  3. 如何将应用发布到App Store

A. 设置

@TheWaWaR
TheWaWaR / LazyTableImages.md
Last active December 15, 2015 23:49
iOS一个动态加载数据到UITableView的源代码例子阅读笔记。

概述

应用程序代理类设置顶层视图控制,并处理了获取RSS信息(XML格式)的连接。RSS信息获取完毕后,使用了任务队列执行xml解析操作。等解析完成后将记录数据添加到记录数组中并刷新顶层视图。 顶层视图控制器控制显示记录数据,并在渲染可见元素时(满足一定条件)下载(默认异步)相应记录中的图片,然后显示出来。

  • 语境说明
    • 应用程序代理类:LazyTableAppDelegate
    • 顶层视图控制器:RootViewController
    • 负责解析XML的类:ParseOperation
    • 负责下载图片的类:IconDownloader
@TheWaWaR
TheWaWaR / Qt-Threading-Basics.md
Last active December 15, 2015 23:49
<Qt Threading Basics> Document Reading Note

What are threads

Blabla... thread is tiny process that share the memory.

  • Thread can run on multicore CPUs. But how about The C10K problem?

GUI Thread and Worker Thread

  • Qt GUI must run in "main thread"

Simultaneous Access to Data

  • Simultaneous access an shared object will be faster that communicate in process, but it's also dangerous.
  • Some cases will cause danger
@TheWaWaR
TheWaWaR / Emacs-info-info.md
Last active December 16, 2015 00:59
<Emacs Info Info> Document Reading Note

Concepts

  • Node : A content section
  • Menu : List subnodes
  • Cross-Reference : Link to some node
  • Index : um...index.
  • Table of Contents : Show node hierarchy
  • History : Just like borwser page history
  • Recents : A list show recent visited nodes
@TheWaWaR
TheWaWaR / install-cx_Oracle.sh
Created June 14, 2013 02:03
在 CentOS 上安装 cx_Oracle
# 从 Oracle 官方网站下载下列文件:
#
# oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
# oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
# oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
# 安装 Oracle 客户端
rpm -ivh oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
@TheWaWaR
TheWaWaR / tmux.conf
Last active April 21, 2016 14:22
My tmux config file
# Created at: [2013-04-28 10:00]
# Updated at: [2015-11-26 10:39]
# Updated at: [2016-01-29 23:51]
set -g utf8
set-window-option -g utf8 on
# Common
set -g mode-keys vi
set-option -g default-shell $TMUX_SHELL # In ~/.bashrc :: export TMUX_SHELL='/usr/local/bin/zsh'
@TheWaWaR
TheWaWaR / upload-as-static-folder.py
Last active December 19, 2015 04:39 — forked from rduplain/app.py
Add *upload* folder as static file folder.
import os
from flask import Flask, send_from_directory
app = Flask(__name__)
@app.route('/upload/<path:filename>')
def send_uploads(filename):
print filename
return send_from_directory(os.path.join(app.root_path, 'upload'), filename)
@TheWaWaR
TheWaWaR / nested_list.qml
Last active December 21, 2015 00:38 — forked from elpuri/gist:3753756
A collapsible nested list example in QML
import QtQuick 1.1
Item {
width: 200
height: 300
ListView {
anchors.fill: parent
model: nestedModel
delegate: categoryDelegate
@TheWaWaR
TheWaWaR / install_jdk7.sh
Last active December 24, 2015 18:09 — forked from ralph-tice/gist:4252866
Install JDK7 in Linux.
#download the JDK
#oracle's rpm.bin gets pulled down as corrupt..zzz
#wget --no-cookies --header "Cookie: gpw_e24=xxx" "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64-rpm.bin" -O jdk-7-linux-x64-rpm.bin
#updated for version 7u11
wget --no-check-certificate --no-cookies --header "Cookie: gpw_e24=xxx" http://download.oracle.com/otn-pub/java/jdk/7u11-b21/jdk-7u11-linux-x64.rpm -O jdk-7u11-linux-x64.rpm
sudo rpm -ivh jdk-7u11-linux-x64.rpm
sudo alternatives --install /usr/bin/java java /usr/java/default/bin/java 20000