Navigation Menu

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 / gist:9318245
Created March 3, 2014 04:12
Secure Preference
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="4cXeqgAiwtMCVYf4x49Cif6/cv6qGWMJBOHdv1Mwqr0">FLxUzXZCb8gOwud0c3GP5TICNZ57D0drzBJu8+rBdPE</string>
<string name="WPku4Iu+9AE0JVkFcLcwuA">5+WnQKWlrj+AB2Nx1FX+bw</string>
<string name="xzXkhiG4ydN2inBq3y24TA">yf4T4ymkifqIDvYeuktHsg</string>
<string name="FZnfw5wRk5izYXEBaYmghw">aWv75LuFpyiAW6+qSivFZKOapz9DcqXNl44PdGNdbOw</string>
</map>
{
id: 7,
title: "Arc",
category: "Alerts",
body: "Arkar is too sexy",
pic_news: {
pic_news: {
url: "/uploads/news/pic_news/7/9ySXAHt.jpg"
}
}
@yelinaung
yelinaung / gist:11202002
Created April 23, 2014 03:33
Insert comma on every three digits
private String insertComma(String digits) {
String result = digits;
if (digits.length() <= 3) {
return digits;
} else {
for (int i = 0; i < (digits.length() - 1) / 3; i++) {
int commaPos = (digits.length() - 3) - (3 * i);
result = result.substring(0, commaPos) + "," + result.substring(commaPos);
}
return result;
mResult.setText(f.format("%,d", ((Long.parseLong(s.toString()) / (Math.round(Float.parseFloat(sharePref.getUSD().replace(",", ""))))))) + "");
@yelinaung
yelinaung / gist:1e38e6b85d405fcd565a
Created May 14, 2014 03:10
Insert Comma for every three digits after dot
private String insertComma(String digits) {
String result = digits;
if (digits.length() <= 3) {
return digits;
} else if (digits.contains(".")) {
String[] x = digits.split("\\.");
for (int i = 0; i < (x[0].length() - 1) / 3; i++) {
int commaPos = (x[0].length() - 3) - (3 * i);
result = result.substring(0, commaPos) + "," + result.substring(commaPos);
}
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' )
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
@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
String number = yourNumberBlahBlah + Uri.encode("#");
Intent i = new Intent(android.content.Intent.ACTION_CALL, Uri.parse("tel:" + number ));
@yelinaung
yelinaung / Sample
Last active August 29, 2015 14:04
SimpleLogger
private String TAG = makeLogTag(LoginActivity.class);
LOGD(TAG, "lat " + getLatLong()[0]);