Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Myat Min Han mmhan

View GitHub Profile
@mmhan
mmhan / original
Last active Jan 4, 2016
The Tortoise and the Hare
View original
There is a Hare and
a tortoise.
The hare and tortoise race.
The hare thinks that he is fast
and the tortoise is slow.
He decided to take a nap.
But he slept for too long and the tortoise passes him.
And the tortoise won the race.
@mmhan
mmhan / gist:8131701
Created Dec 26, 2013
MM Phone Number Regex
View gist:8131701
/^((\+\d+)*(\d+)[- ])*\d{3,}[- ]*\d{3,}$/
View gist:8028360
root (hd0, 5)
kernel /vmlinuz root=/dev/sda6
initrd /initrd.img
boot
@mmhan
mmhan / api.php
Last active Dec 25, 2015
Parameters and terms
View api.php
<?php
/**
* Will take given parameters, query and return a list of listings for given params
*
* PARAMETERS
* ===================
*
* q Search string. Default = null (optional)
* build Car's build type Default = null (optional)
* make Manufacturer Default = null (optional)
View functions.php
<?php
/**
* MMJDB Google docs form embedding
**/
function mmjdb_some_form(){
if(is_page('page_slug')){
echo '<iframe src="https://docs.google.com/spreadsheet/embeddedform?formkey=dE1GWmZYTDNpSG5CSkVRZWgtc0JyWHc6MQ" width="906" height="790" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>';
}
}
View gist:5127558
<?php
// Let's say $result is the data that you want to show with pagination.
//First get all the NRs of the result
$nr = Set::extract("{n}.AF.NR", $data);
//Then get the names of all the companies for the given NR
$companies = $this->FIRMA->find('list', array('conditions' => array("NR" => $nr) ) );
?>
View MCAPI.php
<?php
class MCAPI {
var $version = "1.3";
var $errorMessage;
var $errorCode;
/**
* Cache the information on the API location on the server
*/
View Requests comparison
The following was taken from Firebug's Net panel's POST tab.
This is how flash posted the data for entries/customize
--kysqyjqwoxedwqdyyutnftnihuuproui
Content-Disposition: form-data; name="title"
title
--kysqyjqwoxedwqdyyutnftnihuuproui
@mmhan
mmhan / UserAccessLogTest.java
Created Jun 8, 2012 — forked from anonymous/UserAccessLogTest.java
Reading the input from logfile. Printing the unique login ID from the past 10 mins.
View UserAccessLogTest.java
import java.util.*;
import java.io.*;
import java.util.StringTokenizer;
public class UserAccessLogTest extends GenericTest
{
private String filePath ="";
public UserAccessLogTest(String args[])
{
View gist:2017071
MyanmarCarsDB.com is a classified cars listing site for Myanmar Car Market. We provide the number one online advertising services for buyers, sellers, agents, dealers and importers.
Instantly advertise cars to sell or find your dream cars in a few clicks.
You can’t perform that action at this time.