Skip to content

Instantly share code, notes, and snippets.

View armeo's full-sized avatar

Adisorn Chockaumnuai armeo

View GitHub Profile
@armeo
armeo / WhatIsGist.md
Created October 12, 2012 14:48
What is "Gist"

###What is Gist Gist คือ notepad วิเศษ สามารถ highlight โค้ดได้และ versioning โดยตัวมันเอง และใครๆก็คอมเม้นต์หรือ edit ได้ (ไม่ต้องกลัวอะไรหายเพราะมัน versioning ตัวเอง) พอมี Gist แล้วเราก็ส่ง link ของ Gist หากันและกัน แล้วก็สื่อสารที่ link ของ Gist นั้นๆ

###Highlight Code แต่ละ Gist จะถือเป็น หนี่งภาษา โดยจะนับจากนามสกุลของ gist เช่น gist ที่อ่านอยุ่นี้มีนามสกุล md ฉะนั้น gist นี้เป็นภาษา markdown ลองดูโค้ดของ gist นี้จะเห็นว่ามีเนื้อหาเขียนด้วย markdown Github จะแสดง gist นี้บนหน้าจอเป็น แบบ markdown ให้เอง หากเป็น groovy หรือ java ก็จะ highlight เป็นอีกแบบ เหมาะสมกับภาษา

ทดสอบ

หัวข้อ

  • ที่สอง

#การใช้ Git ฉบับรีบร้อน

##Git Git เป็น revision control แบบ distributed (หมายความว่าไม่มีศูนย์กลาง) และ แบบ non-linear history (หมายความว่ามีประวัติการเปลี่ยนแปลงแบบไม่ใช่เส้นตรง) ดังนั้นทำให้คอนเซปต์ของ Git นั้นต่างจาก revision control รุ่นก่อนหน้าหลายอย่าง

ต่อไปจะอธิบายย่อๆเรื่องคำสั่ง Git โดยอิงกับการทำงานใน GitHub เป็นสำคัญ (Git มีวิธีใช้พลิกแพลงมากมาย ไปศีกษาการใช้อื่นได้ด้วยการไป Google เอาเอง)

##clone

สมมุติว่ามี repository แห่งนีงใน GitHub เช่น https://github.com/norsez/projectA

WordPress Unit Tests Quick Start Guide

This quick start guide is geared towards installing PHPUnit on OSX in order to run the WordPress unit tests. It uses homebrew to install PHP using homebrew-php. You can likely skip this step if you've already got php and pear installed properly.

If you use MAMP, then try these instructions to use MAMP's php and pear to install PHPUnit.

install homebrew

ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
#!/bin/sh
sudo apt-get update
sudo apt-get install openjdk-6-jre
sudo apt-get install openjdk-6-jdk
sudo wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
sudo apt-get install ant
@armeo
armeo / tmux.conf
Created January 31, 2014 04:33
Tmux Config
# Ctrl-b is a bad prefix key, use Ctrl-a instead
set-option -g prefix C-a
unbind-key C-b
# Also assign Ctrl-a to send the prefix to a remote session
bind-key C-a send-prefix
# Windows should be numbered from 1 like panes
set -g base-index 1
@armeo
armeo / vimrc
Created January 31, 2014 04:35
Strip Trailing Whitespace
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
package com.squareup.alcatraz.auth;
import com.google.common.base.Optional;
import com.unboundid.ldap.sdk.Filter;
import com.unboundid.ldap.sdk.LDAPConnection;
import com.unboundid.ldap.sdk.LDAPException;
import com.unboundid.ldap.sdk.ResultCode;
import com.unboundid.ldap.sdk.SearchRequest;
import com.unboundid.ldap.sdk.SearchResult;
import com.unboundid.ldap.sdk.SearchResultEntry;
@armeo
armeo / zsh.md
Created August 25, 2014 14:53 — forked from tsabat/zsh.md
If you want, I can try and help with pointers as to how to improve the indexing speed you get. Its quite easy to really increase it by using some simple guidelines, for example:
- Use create in the index API (assuming you can).
- Relax the real time aspect from 1 second to something a bit higher (index.engine.robin.refresh_interval).
- Increase the indexing buffer size (indices.memory.index_buffer_size), it defaults to the value 10% which is 10% of the heap.
- Increase the number of dirty operations that trigger automatic flush (so the translog won't get really big, even though its FS based) by setting index.translog.flush_threshold (defaults to 5000).
- Increase the memory allocated to elasticsearch node. By default its 1g.
- Start with a lower replica count (even 0), and then once the bulk loading is done, increate it to the value you want it to be using the update_settings API. This will improve things as possibly less shards will be allocated to each machine.
- Increase the number of machines you have so
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static