Skip to content

Instantly share code, notes, and snippets.

@AungWinnHtut
AungWinnHtut / password_animation.py
Created December 30, 2015 04:31 — forked from the-c0d3r/password_animation.py
Movie-like password cracking animation in Python that looks nifty. Code for guessing a string written for a problem in "Problem Solving with Algorithms and Data Structures" with my additional idea of printing every attempt and slowing down prints to make them readable.
import random
import time
import sys
import string
def generate_random_guess(chars):
return random.choice(chars)
def repeated_guesses(target):
@AungWinnHtut
AungWinnHtut / ADB+.BAT
Created February 11, 2016 10:29 — forked from thebagchi/ADB+.BAT
script for issuing commands to multiple android devices on windows
:: Inspired by Linux version of the same https://gist.github.com/christopherperry/3208109
@echo off
SET ARGUMENTS=%~1
if "%ARGUMENTS%" == "" (
GOTO EOF
)
SET "ARGUMENTS=%ARGUMENTS:""="%"
@AungWinnHtut
AungWinnHtut / adb+
Created February 11, 2016 10:30 — forked from christopherperry/adb+
A bash script that let's you issue adb commands to multiple devices at once
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis
@AungWinnHtut
AungWinnHtut / mmstrlen.php
Created June 18, 2016 12:30 — forked from eimg/mmstrlen.php
Count no. of syllabes in a Myanmar Unicode string.
<?php
function mmstrlen($str) {
$standalones = array("ဤ", "၍", "ဪ", "၏", "၊", "။", "၌");
$consonants = array("က", "ခ", "ဂ", "ဃ", "င", "စ", "ဆ", "ဇ", "ဈ", "ည", "ဍ", "ဌ", "ဋ", "ဎ", "ဏ", "တ", "ထ", "ဒ", "ဓ", "န", "ပ", "ဖ", "ဗ", "ဘ", "မ", "ယ", "ရ", "လ", "ဝ", "သ", "ဟ", "ဠ", "အ");
$numbers = array("၀", "၁", "၂", "၃", "၄", "၅", "၆", "၇", "၈", "၉");
$len = mb_strlen($str, "UTF-8");
$count = 0;
for($i = 0; $i < $len; $i++) {
@AungWinnHtut
AungWinnHtut / mmwrap.html
Created June 18, 2016 12:30 — forked from eimg/mmwrap.html
Inserting ZWSP between every syllables for better text wrapping for Myanmar text.
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Break Wrap</title>
<style>
body {
background: #efefdd;
}
@AungWinnHtut
AungWinnHtut / ShortcutKey.cs
Created June 22, 2016 15:28
Shortcut Key creation in C#
// Shortcut Key creation
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == (Keys.Control | Keys.T))
{
MessageBox.Show("What the Ctrl+T?");
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
@AungWinnHtut
AungWinnHtut / fullscreen.java
Created July 18, 2016 14:41
full screen for android activity
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_cadet_ibook_anylist);
}
@AungWinnHtut
AungWinnHtut / updateADT.txt
Created July 18, 2016 15:41
updateADT.txt for latest
See the instructions below
If you are still unable to use Eclipse to download the ADT plugin as a remote update site, you can download the ADT zip file to your local machine and manually install it:
Download the ADT Plugin zip file (do not unpack it): ADT-22.3.0.zip http://dl.google.com/android/ADT-22.3.0.zip
Start Eclipse, then select Help > Install New Software.
Click Add, in the top-right corner.
In the Add Repository dialog, click Archive.
Select the downloaded ADT-22.3.0.zip file and click OK.
Enter "ADT Plugin" for the name and click OK.
package com.example.spinnertest;
import java.util.ArrayList;
import java.util.List;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
@AungWinnHtut
AungWinnHtut / test.cpp
Created August 1, 2016 14:53
test cpp
#include <iostream>
#include<string>
using namespace std;
class Distance
{
private:
int feet;
float inches;
public:
void getdist()