Skip to content

Instantly share code, notes, and snippets.

View aikchun's full-sized avatar
🎯
Focusing

Aik Chun aikchun

🎯
Focusing
View GitHub Profile
import java.util.*;
import java.io.*;
public class TestTry{
public static void main(String []args){
int a = 5;
int b = receiveNumberFromUser();
}
Human::Human(){
// what you want the function to do
}
String Human::getName(){
// what you want the function to do
}
void Human::setAddress(string){
//what you wan the function to do
@aikchun
aikchun / OptionPane.java
Created May 26, 2013 06:45
This OptionPane is to show how to customize JOptionPane showOptionDialog with YES_NO_OPTION
import java.util.*;
import javax.swing.*;
import java.awt.*;
import java.io.*;
public class OptionPane {
public static void main(String []args){
Object[] options = { "OK", "Cancel" };
int choice = JOptionPane.showOptionDialog(null, "Do you want to quit?",
"Exiting",
JOptionPane.YES_NO_OPTION,
#!/bin/bash
###
#
# forked from https://gist.github.com/1264701/08f93534ba177f173b9382b53c419cd0de5b07ea
# Copyright (c) 2011 Cake Development Corporation (http//cakedc.com)
#
# Ubuntu 12.10 based web server installation script
# Run this by executing the following from a fresh install of Ubuntu 12.10 server:
#
public function successfulSomething($data) {
$email = $this->email;
$email->subject('You have successfully done something:' . $data['title']);
$email->template('successful_done');
// This is outdated
// $email->sendAs = 'text';
$email->emailFormat('html'); // This will allow the view to use html tags to be reflected in the email.
$email->viewVars(array('data' => $data); // set multiple variables into email view.
@aikchun
aikchun / 0_reuse_code.js
Created December 1, 2013 07:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@aikchun
aikchun / .vim
Last active December 29, 2015 21:19
vimrc
let mapleader=","
" load plugins
execute pathogen#infect()
let g:EasyMotion_leader_key = '<Leader>'
map <F2> :NERDTreeToggle<CR>
let NERDTreeShowLineNumbers=1
let NERDTreeShowHidden=1
" General configuration
#!/bin/bash
###
#
# forked from https://gist.github.com/1264701/08f93534ba177f173b9382b53c419cd0de5b07ea
# Copyright (c) 2011 Cake Development Corporation (http//cakedc.com)
#
# Ubuntu 12.10 based web server installation script
# Run this by executing the following from a fresh install of Ubuntu 12.10 server:
#
@aikchun
aikchun / imap-gmail
Last active May 24, 2024 09:33
IMAP PHP gmail attachment extractor
<?php
/**
*
* Gmail attachment extractor.
*
* Downloads attachments from Gmail and saves it to a file.
* Uses PHP IMAP extension, so make sure it is enabled in your php.ini,
* extension=php_imap.dll
@aikchun
aikchun / readTextFile
Created January 30, 2014 12:15
Read text file java
public static String readTextFile () {
String fileContent = "";
BufferedReader br = null; ;
try {
br = new BufferedReader (new FileReader("TextFile.txt"));
StringBuilder sb = new StringBuilder();
String fileLine = "";
while ((fileLine = br.readLine()) != null) {
System.out.println(fileLine);
sb.append(fileLine);