Skip to content

Instantly share code, notes, and snippets.

View tuannat's full-sized avatar

Tuan Nguyen tuannat

View GitHub Profile
class Graph {
num nodesNumber;
List<List<num>> edges;
Graph(this.nodesNumber, List<List<num>> edges) {
this.edges = new Iterable.generate(nodesNumber,
(_) => new List.fixedLength(nodesNumber)).toList();
for (var e in edges) edge(e[0], e[1], e[2]);
}
# -*- coding: utf-8 -*-
import Image
def resize_and_crop(img_path, modified_path, size, crop_type='top'):
"""
Resize and crop an image to fit the specified size.
args:
img_path: path for the image to resize.
@tuannat
tuannat / google_twunter_lol
Created October 31, 2012 01:33 — forked from jamiew/google_twunter_lol
All the dirty words from Google's "what do you love" project: http://www.wdyl.com/
easterEgg.BadWorder.list={
"4r5e":1,
"5h1t":1,
"5hit":1,
a55:1,
anal:1,
anus:1,
ar5e:1,
arrse:1,
arse:1,
@tuannat
tuannat / chat-frontend.js
Created October 29, 2012 02:01 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;