Skip to content

Instantly share code, notes, and snippets.

View yukeehan's full-sized avatar

Yukee Han yukeehan

  • Ottawa
View GitHub Profile
@yukeehan
yukeehan / app.js
Created July 4, 2018 15:56
movie search app
var express = require("express");
var app = express();
var request = require("request");
app.set("view engine", "ejs");
app.get("/", function(req, res){
res.render("search");
})
app.get("/results", function(req, res){
@yukeehan
yukeehan / app.js
Created June 28, 2018 17:16
Post Request Demo
var express = require("express");
var app = express();
var bodyParser = require("body-parser");
app.set("view engine", "ejs");
app.use(bodyParser.urlencoded({extend:true}));
var friends = ["Yukee", "Mountain", "Xiaobai", "Tony"];
app.get("/",function(req, res){
@yukeehan
yukeehan / app.js
Last active June 27, 2018 15:35
EJS Demo
var express = require("express");
var app = express();
app.get("/",function(req, res){
res.render("home.ejs");
});
app.get("/love/:thing",function(req, res){
var thing = req.params.thing;
res.render("love.ejs",{thingVar: thing});
@yukeehan
yukeehan / changecolor.html
Created May 29, 2018 02:53
use addEventListener to listen the click and change the background color
<!DOCTYPE html>
<html>
<head>
<title>color changer</title>
<style type="text/css">
button{
font-size: 20px;
margin: 50px;
}
.ispink{
@yukeehan
yukeehan / match.css
Created May 24, 2018 16:22
a simple web using a picture as the background
body{
font-family: Lato;
background: url(https://images.unsplash.com/photo-1511275539165-cc46b1ee89bf?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=4eed771c93754c026e4a14e74dc3251d&auto=format&fit=crop&w=1050&q=80);
background-size: cover;
}
html{
height: 100%
}
.content{
text-align: center;
@yukeehan
yukeehan / gallery.css
Created May 23, 2018 19:46
a simple photo gallery including navbar
@yukeehan
yukeehan / SwingFC
Created May 17, 2018 15:51
Swing file compare
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class SwingFC implements ActionListener {
JTextField jtfFirst; // holds the first file name
JTextField jtfSecond; // holds the second file name
@yukeehan
yukeehan / JList
Created May 17, 2018 14:55
Swing JList
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
public class ListDemo implements ListSelectionListener {
JList<String> jlst;
JLabel jlab;
JScrollPane jscrlp;
@yukeehan
yukeehan / CBDemo
Created May 17, 2018 14:15
check box Swing
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class CBDemo implements ItemListener {
JLabel jlabSelected;
JLabel jlabChanged;
JCheckBox jcbAlpha;
JCheckBox jcbBeta;
@yukeehan
yukeehan / TFDemo
Created May 16, 2018 21:02
Swing JBotton, JFrame , Jlabel and JTextFiled
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;