Skip to content

Instantly share code, notes, and snippets.

View anonoz's full-sized avatar
🎣
ikan duit

anonoz

🎣
ikan duit
View GitHub Profile
@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
# Git: Because it's time to learn how to team code like the pros
## Contents
1. Why learn git - The Programmers' Dropbox Dilemma
2. Getting started - Download and setup git
3. Sample project and scenario - A sample website, 3 programmers in a team
4. git init, add, commit - Your first commit
5. git status, diff, log - Second commit
6. git checkout, branch, merge, rebase - Let's get experimental
7. GitHub - Social Coding Platform
@anonoz
anonoz / anonoz-uni-groupwork-framework.md
Last active August 29, 2015 13:59
An Idea of How We Do Group Assignments in The Future
@anonoz
anonoz / footer.html
Created October 20, 2014 16:20
GSA Campus Android Meetup eventbrite codes
@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 / 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 / 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 / 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 / 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; }