Skip to content

Instantly share code, notes, and snippets.

View hoandang's full-sized avatar
👟
Roaming

Hoàn Đặng hoandang

👟
Roaming
  • Sydney, Australia
View GitHub Profile
@hoandang
hoandang / jquery: combine_string_with_this.js
Created February 17, 2013 11:27
Combine selector with this in Jquery
$("selector", this)
@hoandang
hoandang / css: valign_table_row.css
Created February 17, 2013 11:28
Align middle table row
table tbody tr td
{
vertical-align: middle;
}
@hoandang
hoandang / java: JPAGetIdPersistedObj.java
Created February 23, 2013 15:48
Get Id from the persisted object JPA
import javax.persistence.GenerationType;
import javax.persistence.GeneratedValue;
@GeneratedValue(strategy=GenerationType.IDENTITY)
@hoandang
hoandang / sql: remoteMySQL.sql
Created March 11, 2013 15:49
Connect MySQL remotely
mysql -u <server username db> -p -h <server address (eg: ec2-23-21-211-172.compute-1.amazonaws.com)>
@hoandang
hoandang / shorcuts.txt
Last active December 15, 2015 00:49
Forgettable Shorcuts
\ + c + <Space>: comment in VIM
\ + b +e : Open buffer in VIM
<eject> + Shift + control: Turn off screen macbook
@hoandang
hoandang / sql: schema_tables.sql
Created March 21, 2013 08:37
Select all tables from a particular schema
SELECT table_name FROM all_tables WHERE owner='<schema name>'
@hoandang
hoandang / sql: create_table.sql
Last active December 15, 2015 05:49
Create table from another table
create table <table_name> as (<select statement goes here>)

Setup new Mac with OSX Lion from scratch

These commands are good as of 2011-07-27.

Install Xcode 4

The download/install takes a while so start it first. When it finishes downloading you will still need to run it to complete installation.

Really the nicest choice for a terminal on OSX right now, especially with Lion style full screen support.

@hoandang
hoandang / index.html
Created June 27, 2013 07:14 — forked from mfkp/index.html
Integrate mailchimp service
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.ketchup.all.min.js" type="text/javascript"></script>
</head>
<body>
<div id="email">
<span>Enter your email to sign up</span>
<form action="/subscribe.php" id="invite" method="POST">
@hoandang
hoandang / pretty_var_dump.php
Created July 3, 2013 15:39
Pretty var_dump for PHP
echo'<pre>';var_dump($records);
or
using http://raveren.github.io/kint/#advanced