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
@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)
}
}
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 / 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'
@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
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 / Sample
Last active August 29, 2015 14:04
SimpleLogger
private String TAG = makeLogTag(LoginActivity.class);
LOGD(TAG, "lat " + getLatLong()[0]);
String number = yourNumberBlahBlah + Uri.encode("#");
Intent i = new Intent(android.content.Intent.ACTION_CALL, Uri.parse("tel:" + number ));
@yelinaung
yelinaung / gist:ae19e4ec6f05c2aa54e5
Created June 10, 2014 05:27
Simple FizzBuzz in Swift
//
// main.swift
// SwiftTest
//
// Created by Ye Lin Aung on ၁၄/၀၆/၁၀.
// Copyright (c) ၂၀၁၄ Ye Lin Aung. All rights reserved.
//
import Foundation
def uni512zg1(input_text)
output_text = input_text
puts output_text
{% for rule in uni512zg1_rules -%}
output_text = output_text.gsub("{{rule.0}}","{{rule.1|replace("$","\\\\") }}")
{% endfor -%}
end
def zg12uni51(input_text)
output_text = input_text
def uni512zg1(input_text)
output_text = input_text
output_text = output_text.gsub('\u104E\u1004\u103A\u1038','\u104E' )
output_text = output_text.gsub('\u102B\u103A','\u105A' )
output_text = output_text.gsub('\u102D\u1036','\u108E' )
output_text = output_text.gsub('\u103F','\u1086' )
output_text = output_text.gsub('(?<=\u102F)\u1037','\u1094' )
output_text = output_text.gsub('(?<=\u102F\u1036)\u1037','\u1094' )
output_text = output_text.gsub('(?<=\u1030)\u1037','\u1094' )
output_text = output_text.gsub('(?<=\u1030\u1036)\u1037','\u1094' )