Skip to content

Instantly share code, notes, and snippets.

View winsandymyint's full-sized avatar
:octocat:
Nothing Special

Win Sandy Myint winsandymyint

:octocat:
Nothing Special
View GitHub Profile
var reader = new FileReader();
reader.onload = function(evt) {
$scope.$apply(function($scope) {
$scope.preview = evt.target.result;
});
};
reader.readAsDataURL(file);
@winsandymyint
winsandymyint / loveletter.js
Created May 25, 2016 16:51
A love letter function written by ECMA 6 arrows
let message= function(heartSay){
[73 , 32, 108, 111, 118, 101, 32, 121, 111, 117].forEach(function(value){
heartSay+=String.fromCharCode(value)
});
return heartSay;
}
message('')
//"I love you"
/* Another Ways of calling the above function by using ECMAScript 6 arrows */
@winsandymyint
winsandymyint / index.js
Created October 29, 2015 04:04 — forked from joshbeckman/index.js
An example Node.js server that can verify a Shopify webhook's integrity. Run with `node index.js`.
const PORT = 3000;
const SECRET = 'APP_SHARED_SECRET';
var http = require('http'),
crypto = require('crypto'),
server;
function verifyShopifyHook(req) {
var digest = crypto.createHmac('SHA256', SECRET)
.update(new Buffer(req.body, 'utf8'))
<?php
function mmstrlen($str) {
$standalones = array("ဤ", "၍", "ဪ", "၏", "၊", "။", "၌");
$consonants = array("က", "ခ", "ဂ", "ဃ", "င", "စ", "ဆ", "ဇ", "ဈ", "ည", "ဍ", "ဌ", "ဋ", "ဎ", "ဏ", "တ", "ထ", "ဒ", "ဓ", "န", "ပ", "ဖ", "ဗ", "ဘ", "မ", "ယ", "ရ", "လ", "ဝ", "သ", "ဟ", "ဠ", "အ");
$numbers = array("၀", "၁", "၂", "၃", "၄", "၅", "၆", "၇", "၈", "၉");
$len = mb_strlen($str, "UTF-8");
$count = 0;
for($i = 0; $i < $len; $i++) {