Skip to content

Instantly share code, notes, and snippets.

View yelinaung's full-sized avatar
🏠
Working from home

Ye Lin Aung yelinaung

🏠
Working from home
View GitHub Profile
public class L {
private static final String LOG_PREFIX = "ys_";
private static final int LOG_PREFIX_LENGTH = LOG_PREFIX.length();
private static final int MAX_LOG_TAG_LENGTH = 23;
public L() {
}
public static String makeLogTag(String str) {
if (str.length() > MAX_LOG_TAG_LENGTH - LOG_PREFIX_LENGTH) {
@yelinaung
yelinaung / build.gradle
Created September 11, 2014 16:56
Poh Android build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.poh.poh"
minSdkVersion 16
targetSdkVersion 20
@yelinaung
yelinaung / Gemfile
Created September 11, 2014 17:00
Poh API Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
# ruby '2.1.1'
gem 'rails', '4.1.5'
# Use sqlite3 as the database for Active Record
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
public static void main(String[] args) {
// odd/even into lists of 10
Observable.range(1, 100).groupBy(n -> n % 2 == 0)
.flatMap(g -> {
return g.take(10).toList();
}).forEach(System.out::println);
}
@yelinaung
yelinaung / fibonacci.go
Last active August 29, 2015 14:10
Fibonacci Stuff
package main
import ()
func main() {
for i := 0; i < 50; i++ {
// fmt.Printf("i is %d and result is %d.\n", i, fibo(i))
fibo(i)
}
}
@yelinaung
yelinaung / exp#1.js
Last active August 29, 2015 14:11
λ Lambda Camp (Responses). Event url : https://www.facebook.com/events/1498733757081658
function power(base,expo) {
switch(expo) {
case 0: return 1;
case 1: return base;
default: expo--;return base*power(base,expo);
}
}
@yelinaung
yelinaung / 1989.json
Last active August 29, 2015 14:16
1989 in JSON
{
"artist": "Taylor Swift",
"album": "1989",
"desciption": "1989 is the fifth studio album by American singer-songwriter Taylor Swift. It was released on October 27, 2014, through Big Machine Records.",
"songs": [
{
"title": "Welcome To New York",
"artist": "Taylor Swift",
"album": "1989",
"composer": "Taylor Swift & Ryan Tedder",
@yelinaung
yelinaung / Converter.java
Created April 8, 2015 08:12
Generated Java converter from Paytan. License : GPL v3
// Zawgyi<>Unicode converter python module
// Based on rules from Parabaik Myanmar Text Converter
// Copyright (C) 2014 Ngwe Tun (Solveware Solution)
// Copyright (C) 2014 Ye Mon Kyaw
// This file is part of Paytan.
// Paytan is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
λ ~:mm-sort gem install ffi-icu
λ ~:mm-sort irb
2.2.2 :001 > require 'ffi-icu'
true
2.2.2 :002 > collator = ICU::Collation::Collator.new("mm")
#<ICU::Collation::Collator:0x007ff982336610 @c=#<FFI::AutoPointer address=0x007ff9837e2610>>
2.2.2 :003 > collator.collate(["အို", "အ", "အေ", "အု", "အော်", "အော", "အံ"])
[
[0] "အ",
[1] "အံ",
@yelinaung
yelinaung / mmaug_simple_databinding_build.gradle
Last active August 29, 2015 14:23
Top-level build file where you can add configuration options common to all sub-projects/modules.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:1.3.0-beta2"
classpath "com.android.databinding:dataBinder:1.0-rc0"