Skip to content

Instantly share code, notes, and snippets.

@amaudy
amaudy / zendwebapp.localhost
Created November 6, 2011 06:14
Apache Virtual host config file
NameVirtualHost zendwebapp.localhost:80
<VirtualHost zendwebapp.localhost:80>
ServerAdmin webmaster@localhost
ServerName zendwebapp.localhost
DocumentRoot /home/demo/zendwebapp/public
<Directory /home/demo/zendwebapp/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
@amaudy
amaudy / gist:1342634
Created November 6, 2011 09:18
Zend framework setup

#Zend framework on Ubuntu 11.10#

  • เตรียม Web server/Database server
  • ดาวน์โหลดและติดตั้ง Zend framework
  • สร้าง Zend framework โปรเจคท์ด้วย Zend command line tool
  • สร้างเวอร์ชวลโฮสต์ (Virtual host)

ผมจะสมมติว่าใช้ Ubuntu 11.10 แบบติดตั้งเพิ่งเสร็จใหม่ๆ นะครับ

อันดับแรกต้องติดตั้ง Apapche/PHP/MySQL ก่อน ด้วยคำสั่ง

@amaudy
amaudy / gist:1357530
Created November 11, 2011 08:48
download video from youtube, vimeo, blip.tv
กลับไปดูวิดีโอใน Google Developers ที่ทำ Bookmarks ไว้บน Youtube ปรากฎว่าโดนลบไปหลายอัน
นึกขึ้นได้ว่าน่าจะโหลดเก็บไว้ เผื่อโดนลบอีก
จะให้ใช้ Firefox extensions ก็ไม่ไหว เคยมีเรื่องไม่ประทับใจกันมาก่อน
ไปเจอคาถา(สคริปต์) youtube-dl ใน github.com ลองโหลดมาใช้งานแล้วประทับใจ
youtube-dl
สรรพคุณ : โหลดวิดีโอจาก Youtube, Vimeo, Blip.tv
วิธีติดตั้ง : youtube-dl เขียนด้วย Python ถ้ามี Python ในเครื่อง ก็ไม่จำเป็นต้องติดตั้งอะไรเพิ่มเติม
วิธีใช้ : เปิด terminal ขึ้นมาแล้วร่ายมนต์ด้วยคำสั่ง youtube-dl -t http://link.to/video
เช่น ถ้าผมจะโหลด http://www.youtube.com/watch?v=CxLL-sR6XfM คำสั่งเต็มๆ คือ
@amaudy
amaudy / find_dupplicate.sql
Created May 24, 2012 15:40
mongodb: Find dupplicate users and save to second collection
var previous_userid;
db.users.find( {"userid" : {$exists:true} }, {"userid" : 1} ).sort( { "userid" : 1} ).forEach( function(current) {
if(current.userid == previous_userid){
db.duplicates.update( {"_id" : current.userid}, { "$inc" : {count:1} }, true);
}
previous_userid = current.userid;
});
@amaudy
amaudy / randome_chars.lua
Created May 26, 2012 09:47
Random characters
function randOneChar()
local chars = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}
output=math.random(1, #chars)
return output
end
for counter=1,10 do
print(randOneChar())
end
@amaudy
amaudy / gist:2871051
Created June 4, 2012 21:50
How I learn English.
ภาษาเป็นเรื่องของ "ทักษะ" ครับ
และทักษะมันเป็นเรื่องที่ฝึกกันได้ :)
อารมณ์เดียวกับฝึกเขียนโปรแกรมนั่นแหละ
ทีนี้คำถามคือ แล้วจะฝึกอย่างไร?
พี่ขอแชร์ประสบการณ์การฝึกภาษาของพี่ให้ฟังนะครับ (จริงๆ อ่าน)
เมื่อก่อนความสามารถเรื่องภาษาอังกฤษของผมก็เหมือนคนไทยทั่วๆ ไป ที่เรียนภาษาอังกฤษกันตั้งหลายปี แต่พูดสื่อสารกับชาวต่างชาติไม่ได้ (แต่สื่อสารด้วยวิธีอ่าน/เขียนพอได้)
จุดเปลี่ยนของผมเริ่มต้นเมื่อประมาณ 3-4 ปีที่แล้ว ตอนไปงานบาร์แคมป์กรุงเทพ ครั้งที่ 2
ได้เจอผู้คนเยอะแยะมากมาย รวมถึงฝรั่งที่กระตือรือร้นพร้อมจะแชร์เทคนิคการเขียนโปรแกรม เทคนิคการทำธุรกิจให้ฟัง
ตอนนั้นก็ฟังไม่รู้เรื่องหรอก แต่ดีตรงที่ว่าในงานมีคนไทยที่เก่งภาษาเป็นคนช่วยแปลให้
@amaudy
amaudy / emoji_sad.txt
Created November 28, 2012 23:36 — forked from mranney/emoji_sad.txt
Why we can't process Emoji anymore
From: Chris DeSalvo <[email protected]>
Subject: Why we can't process Emoji anymore
Date: Thu, 12 Jan 2012 18:49:20 -0800
Message-Id: <[email protected]>
--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
@amaudy
amaudy / Rakefile
Created December 29, 2012 05:09 — forked from albrow/Rakefile
# ...
desc "Deploy website to s3/cloudfront via aws-sdk"
task :s3_cloudfront => [:generate, :minify, :gzip, :compress_images] do
puts "=================================================="
puts " Deploying to Amazon S3 & CloudFront"
puts "=================================================="
# setup the aws_deploy_tools object
config = YAML::load( File.open("_config.yml"))
require 'rubygems'
require 'sinatra'
require 'fileutils'
# upload with:
# curl -v -F "data=@/path/to/filename" http://localhost:4567/user/filename
# or just go to http://localhost:4567/user/filename with a browser
get '/:name/:filename' do

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.