Skip to content

Instantly share code, notes, and snippets.

View khzaw's full-sized avatar
💻
Crushing it

Kaung Htet khzaw

💻
Crushing it
View GitHub Profile
@khzaw
khzaw / gist:1364290
Created November 14, 2011 16:06
Opening current buffers in respective browsers
abbrev ff :!open -a Firefox.app %:p<cr>
abbrev chrome :!open -a Google\ Chrome.app %:p<cr>
abbrev sf :!open -a Safari.app %:p<cr>
@khzaw
khzaw / dabblet.css
Created February 2, 2012 15:27 — forked from chriscoyier/dabblet.css
Ratings Stars
/*
Ratings Stars
(with as little code as possible)
*/
.rating {
unicode-bidi: bidi-override;
direction: rtl;
text-align: center;
}
.rating > span {
@khzaw
khzaw / colorschemes
Created May 4, 2014 04:31
Color schemes bundles
" colorschemes {{{
NeoBundle 'biskark/vim-ultimate-colorscheme-utility'
NeoBundle 'flazz/vim-colorschemes'
NeoBundle 'altercation/vim-colors-solarized'
NeoBundle 'Lokaltog/vim-distinguished'
NeoBundle 'sjl/badwolf'
NeoBundle 'chriskempson/tomorrow-theme', { 'rtp' : 'vim/' }
NeoBundle 'w0ng/vim-hybrid'
NeoBundle 'zaiste/Atom'
NeoBundle 'tomasr/molokai'
var inOrnagai = function(word) {
var result = [];
makeRequest(word, function(status, response) {
var words = JSON.parse(response);
result = words.filter(function(value) {
return value.word.toLowerCase() === word.toLowerCase();
});
console.log("Inside: ", result);
});
console.log("Outside: ", result);
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@khzaw
khzaw / Zayexponentiation.ml
Last active August 29, 2015 14:11
Recursive exponentiation
let (<>) a b =
let rec timesPrime a b acc = match b with
| 0 -> acc
| _ -> timesPrime a (pred b) (acc+a)
in timesPrime a b 0
;;
let rec pow x = function
| 0 -> 1
| n when n mod 2 = 0 ->
@khzaw
khzaw / cpp
Created December 10, 2014 20:45
#include <iostream>
using namespace std;
int main(void) {
int i = 37;
float f = *(float*)&i;
cout << f << endl;
return 0;
}
@khzaw
khzaw / -
Created December 10, 2014 20:57
#include <iostream>
using namespace std;
int main(void) {
int i = 37;
float f = *(float*)&i;
cout << f << endl;
return 0;
}
@khzaw
khzaw / UnicodeRegexTest.java
Created December 17, 2014 11:09
Translate unicode digits to english numerals
import java.util.regex.*;
public class RegexTest {
public static void main(String[] args) {
String burmeseNumbers = "၀၁၂၃၄၅၆၇၈၉";
String engRegex = "0|1|2|3|4|5|6|7|8|9";
String burmeseRegex = "၀|၁|၂|၃|၄|၅|၆|၇|၈|၉";
@khzaw
khzaw / lab1.sql
Created January 28, 2015 01:32
CS2101 Lab1
-- 1
CREATE TABLE book (
title VARCHAR(256) NOT NULL,
format CHAR(9) NOT NULL,
pages INT,
authors VARCHAR(256),
publisher VARCHAR(256),
year DATE,
edition INT,
ISBN10 CHAR(10) NOT NULL UNIQUE,