Skip to content

Instantly share code, notes, and snippets.

View raykao's full-sized avatar
🇨🇦
¯\_(ツ)_/¯

Raymond Kao raykao

🇨🇦
¯\_(ツ)_/¯
View GitHub Profile
@raykao
raykao / Fetch.sublime-settings
Last active December 16, 2015 03:49
config: Nettuts+ Fetch
{
"files":
{
"jquery": "http://code.jquery.com/jquery.min.js",
"normalize": "https://raw.github.com/necolas/normalize.css/master/normalize.css"
},
"packages":
{
"html5_boilerplate": "https://github.com/h5bp/html5-boilerplate/zipball/master",
"wordpress": "http://wordpress.org/latest.zip",
@raykao
raykao / notes.sublimetext.packages.txt
Created April 12, 2013 16:22
Notes: Sublime Text Packages
Nettuts+ Fetch
Prefixr
Emmet
AdvancedNewFile
Sublime Linter
SideBarEnhancements
Gist
DocBlockr
LiveReload

Basic Git/GitHub Commands:

Creating an initial repository

Assuming you've created a directory called project_dir and all your code/files/folders/assets etc are in this folder then you can initialize your git repo by running the following in your $ shell/terminal prompt:

project_dir$ git init
@raykao
raykao / bash_profile
Created May 13, 2013 02:17
bash_profile settings
export PATH=/usr/local/bin:$PATH
export GITAWAREPROMPT=~/.bash/git-aware-prompt
source $GITAWAREPROMPT/main.sh
export PS1="\u@\h \W \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
@raykao
raykao / retina.css
Created May 15, 2013 17:35
Retina CSS Examples
#stripe{
height:5px;
background:url('/static/img/stripe.gif') repeat-y center top;
-webkit-background-size:1000px 1px;
-moz-background-size:1000px 1px;
background-size:1000px 1px;
}
@media screen and (-webkit-device-pixel-ratio:2.0){
#stripe{
@raykao
raykao / MAMP mySQL2 gem libmysqlclient.18.dylib
Created June 4, 2013 18:41
Pointing mySQL2 libmysqlclient.18.dylib to the proper location with MAMP
http://blog.mirotin.net/35/mamp-1-9-5-mysql-5-5-9-and-ruby-mysql2
sudo install_name_tool -change libmysqlclient.18.dylib /Applications/MAMP/Library/lib/libmysqlclient.18.dylib ~/.rvm/gems/ruby-2.0.0-p0/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
gem install mysql2 -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
database.yml
socket: /Applications/MAMP/tmp/mysql/mysql.sock
http://coolestguyplanettech.com/downtown/install-and-configure-apache-mysql-php-and-phpmyadmin-osx-108-mountain-lion
@raykao
raykao / set_temp_key.rb
Last active December 21, 2015 04:09 — forked from krames/set_temp_key.rb
Ruby script to set temp_url_key for Rackspace Cloudfiles
require 'fog'
# Please replace these with the approprate values
RACKSPACE_USERNAME = ENV['RACKSPACE_USERNAME']
RACKSPACE_API_KEY = ENV['RACKSPACE_APIKEY']
RACKSPACE_TEMP_URL_KEY = ENV['RACKSPACE_CLOUDFILES_TEMPURL_KEY'] # Self generated random string used like an auth token
puts "Creating Storage Service"
@raykao
raykao / gist:6440925
Last active December 22, 2015 07:49
Adding System Stats display on SSH login for Ubuntu
$ sudo apt-get install update-motd
$ sudo apt-get install landscape-common
@raykao
raykao / box-sizing.css
Created September 15, 2013 13:27
CSS Set all elements box-sizing
*, *:before, *:after {
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
}
@raykao
raykao / Ubuntu-Creating-Swap-File
Last active March 17, 2021 14:35
How to create a swap file on ubuntu 12.04. Summary from: [Digital Ocean](https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04)
# Summary from: https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04
# 1. Check if swap exists returns single line output if swap doesn't exist
$ sudo swapon -s
Filename Type Size Used Priority
# 2. Check disk space on root (/) with DF command:
$ df
Filesystem 1K-blocks Used Available Use% Mounted on