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: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
View gist:2e0e7ab8ea677a79f8cf
Composer Commands:
composer self-update | Update composer for Windows environment
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: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: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:cb1a2b4d99a1e0d3d7fe
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
/**
* ArrayList in Java is for create dynamic arrays
*/
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: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:134add875ccbfa1fceeb
Eclipse Commands
ctrl+shift+o | Organize packages import
alt+shift+j | Add a Javadoc comment
ctrl+alt+down | Duplicate selected line of code
alt+up | Move current line up
View gist:03b90bd5f2fe174b7874
<?php
$images = array(
'logo.png',
'background.jpg',
'http://www.hardcoregamer.com/wp-content/uploads/2014/03/BAK_Sshot019.jpg'
);
foreach ($images as $image) {
$src = (substr($image,0,4) == 'http') ? $image : "images/$image";
You can’t perform that action at this time.