Skip to content

Instantly share code, notes, and snippets.

Vien Hoang vienhoang

Block or report user

Report or block vienhoang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:60dc743ccf08ecca2b97
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.Set;
public class Main {
public static void main(String[] args) {
View gist:7c067dd0004a6c3bb1de
import java.util.HashMap;
public class Main {
public static void main(String[] args) {
// HashMap works like associate array
HashMap<String, String> map = new HashMap<String, String>();
map.put("California", "Sacramento");
map.put("Oregon", "Salem");
View gist:cb1a2b4d99a1e0d3d7fe
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
/**
* ArrayList in Java is for create dynamic arrays
*/
View gist:d5bcdab9025d8631c495
public class Main {
public static void main(String[] args) {
String[][] states = new String[3][2];
states[0][0] = "California";
states[0][1] = "Sacremento";
states[1][0] = "Oregon";
View gist:46906604d532e7febdb8
JavaScript Notes
==========================================================
To declare an object
==========================================================
function Rectangle(w, h) {
this.width = w;
this.height = h;
};
==========================================================
Create a new instance of the object
View gist:c0fbfdc8361b347f5cff
Install Package control first: https://sublime.wbond.net/installation
Great Sublime plugins to have:
LESS
Git
Gist
GitGutter
Emmet
PlainTasks
WordPress Developer Resources
View gist:2e0e7ab8ea677a79f8cf
Composer Commands:
composer self-update | Update composer for Windows environment
View gist:63a4b147bbe266adbddd
Working in terminal
cd | Change directory
ls | List directory
ls -al | List all files with permissions showned
mv | Change file name, mv #filename1 #filename2
mv * .. | Move everything up one directory
rm | Remove file, rm #filename
wget | Download a file, wget #filelocation
tar --xzvf | Extract .gz file, tar --xzvf #filename
@vienhoang
vienhoang / gist:e4c7dec93bd3e1c259ce
Created Aug 11, 2014
PHP: Break out of foreach func
View gist:e4c7dec93bd3e1c259ce
function limiting($num) {
$fruits = array('bananas', 'apples', 'pear');
foreach ( $fruits as $v ) {
if ( $num-- === 0) {
break;
}
@vienhoang
vienhoang / vh_options.php
Created Aug 11, 2014
WordPress: Create custom options page
View vh_options.php
<?php
/*
Plugin Name: VH Options
Plugin URI: http://vienhoang.com
Description: Options page for a theme.
Version: 1.0
Author: Vien Hoang
Author URI: http://vienhoang.com
License: GPL2
*/
You can’t perform that action at this time.