Skip to content

Instantly share code, notes, and snippets.

View anonoz's full-sized avatar
🎣
ikan duit

anonoz

🎣
ikan duit
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anonoz
anonoz / chanwaikok.rb
Created August 27, 2015 13:12
TSN2201 Question 3 Solution
require 'sinatra'
require 'sinatra/reloader' if development?
helpers do
def protected!
return if authorized?
headers['WWW-Authenticate'] = 'Basic realm="Restricted Area"'
halt 401, "Not authorized\n"
end
@anonoz
anonoz / mysqli_db_conn.php
Last active August 29, 2015 14:24
PDO vs MySQLi
<?php
// Our database config
$db_host = "localhost";
$db_user = "yolol";
$db_pass = "yolol_pass";
$db_name = "yolol";
// Connect to our MySQL database
$conn = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
@anonoz
anonoz / howbig.sh
Created June 3, 2015 15:31
howbig are the files in directory ah
# Make sure you have coreutils, install it like this:
# brew install coreutils
# Paste this in ~/.bash_profiles
function howbig() { du -hs ./*/ | gsort -h; }
@anonoz
anonoz / roman_numeral_converter_spec.rb
Last active August 29, 2015 14:12
Done in ruby tuesday 16 for code kata, thanks Jimmy Ngu
# Refer http://literacy.kent.edu/Minigrants/Cinci/romanchart.htm
require 'rspec/given'
require 'roman_numeral_converter'
describe RomanNumeralConverter do
Given(:converter) { RomanNumeralConverter.new }
Then { converter.convert(1) == 'I' }
Then { converter.convert(2) == 'II' }
@anonoz
anonoz / Screenshot 2014-12-11 17.55.39.png
Last active August 29, 2015 14:10
MMU Database Fundamentals Assignment
Screenshot 2014-12-11 17.55.39.png
@anonoz
anonoz / hotel_biz_rule.md
Last active May 1, 2017 08:15
TIS1101 Project

Hotel booking systems

Entities:

  • Hotels
  • Rooms
  • Additional Services
  • Customers
  • Bookings
  • Guests
@anonoz
anonoz / tis1101_lab05.sql
Last active August 29, 2015 14:09
TIS1101 labs
create database store;
connect to store;
-- create tables
create table sales_representatives
(
id int primary key not null,
name varchar(255),
@anonoz
anonoz / mmu_card.rb
Created November 6, 2014 10:12
Code to scan MMU card's UID, return the serial number
require 'nfc'
# Read
c = NFC::Context.new
d = c.open nil
puts "Put your card..."
e = d.select
# UID
@anonoz
anonoz / footer.html
Created October 20, 2014 16:20
GSA Campus Android Meetup eventbrite codes