Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Htain Lin Shwe saturngod

💭
I may be slow to respond.
Block or report user

Report or block saturngod

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@saturngod
saturngod / shouldupdate.kt
Created Jul 24, 2019
Check version compare to update or not
View shouldupdate.kt
fun shouldUpgrade(server_version: String, app_version: String): Boolean {
if (server_version == app_version) {
return false
}
val versions = server_version.split(".")
val apps = app_version.split(".")
@saturngod
saturngod / binhex.kt
Last active Apr 6, 2018
bin2hex and hex2bin
View binhex.kt
//bin2hex and hex2bin with Kotlin
import javax.xml.bind.DatatypeConverter
fun bin2hex(byteArray: ByteArray): String {
return DatatypeConverter.printHexBinary(byteArray);
}
fun hex2bin(binary: String): ByteArray {
return DatatypeConverter.parseHexBinary(binary)
@saturngod
saturngod / en2mmno.kt
Created Nov 28, 2017
English Number to Myanmar Number
View en2mmno.kt
/**
* Created by saturngod on 28/11/17.
*/
fun main(args:Array<String>) {
var k = "49085678237896"
print(getMMNumber(k))
View bubblesort.mm
NSMutableArray *res2 = [[NSMutableArray alloc] initWithArray:@[@2,@34,@452,@45,@234,@6,@3,@1,@343,@543,@23,@2,@34,@452,@45,@234,@6,@3,@1,@343,@543,@23,@2,@34,@452,@45,@234,@6,@3,@1,@343,@543,@23,@2,@34,@452,@45,@234,@6,@3,@1,@343,@543,@23]];
int passnum = res2.count -1 ;
BOOL exchange = YES;
NSDate *date = [NSDate date];
while (passnum >0 && exchange) {
exchange = false;
for (int i = 0 ; i < passnum ; i++)
View uibarbuttonwithimage.mm
UIImage *chatImage = [UIImage imageNamed:@"08-chat.png"];
UIButton *chatButton = [UIButton buttonWithType:UIButtonTypeCustom];
[chatButton setBackgroundImage:chatImage forState:UIControlStateNormal];
[chatButton setTitle:@"Chat" forState:UIControlStateNormal];
chatButton.frame = (CGRect) {
.size.width = 100,
.size.height = 30,
};
View VerbalExpressions_Math.js
var tester = VerEx()
.then( "http" )
.maybe( "s" )
.then( "://" )
.maybe( "www." )
.anythingBut( " " );
// Create an example URL
var testMe = "This is testing. https://www.google.com is a URL. http://www.facebook.com also URL.";
var result = testMe.match(tester);
@saturngod
saturngod / myanmartext.js
Created Feb 13, 2013
check myanmar text or not
View myanmartext.js
var regexMM = new RegExp("[\u1000-\u109f\uaa60-\uaa7f]+");
var text = "မြန်မာ";
if (!regexMM.test(text)) {
console.log("not myanmar text");
}
else {
console.log("myanmar text");
}
View mahabote.php
<?php
$arr[0] ="အဓိပတိ";
$arr[1] = "ဘင်္ဂ";
$arr[2] = "မရဏ";
$arr[3] = "အထွန်း";
$arr[4] = "သိုက်";
$arr[5] = "ရာဇ";
$arr[6] = "ပုတိ";
$n = 5; // modulo
@saturngod
saturngod / samplepush.php
Created Jan 24, 2013
apple sample push notification
View samplepush.php
<?php
$deviceToken = '0a7d65e6 b621fbf2 7fb43b23 cb673af5 d689fdfa d2f9a8b2 59d2f507 f1e72a9c';
$payload['aps'] = array('alert' => 'push message suppose to be here but not here yet', 'title' =>'Im Title', 'badge' => 1, 'sound' => 'default', 'category' => 'notification');
$payload = json_encode($payload);
echo $payload."<br/>";
@saturngod
saturngod / mmwebfonts.html
Created Jan 17, 2013
example usages of font embed
View mmwebfonts.html
<html>
<head>
<title>Testing</title>
<meta charset="UTF8">
<!-- <link rel='stylesheet' href='http://mmwebfonts.comquas.com/fonts/?font=mon3' /> -->
<style>
@font-face {
font-family:'MON3 Anonta 1';
src:local('MON3 Anonta 1'),url('http://mmwebfonts.comquas.com/fonts/mon3.ttf');
}
You can’t perform that action at this time.