Skip to content

Instantly share code, notes, and snippets.

View Arkar-Aung's full-sized avatar
🥱

Arkar Aung Arkar-Aung

🥱
View GitHub Profile
@Arkar-Aung
Arkar-Aung / rename.sh
Created January 5, 2016 06:29
Rename downloaded manga file to well-organize name
#!/bin/bash
# Filename: rename.sh
path=$1
extension=$2
count=1
replace=""
for entry in "$path"/*
do
oldfile=$(echo ${entry/$path/$replace}| cut -d'/' -f 2)
@Arkar-Aung
Arkar-Aung / cipher.js
Last active January 1, 2016 12:15
A simple cipher in js
var Cipher = (function () {
var shiftCharactor = function (charAt) {
if (charAt == 65) {
return 93; // A -> Z
} else if (charAt == 97) {
return 122; // a -> z
} else if (charAt == 93) {
return 65; // Z -> A
} else if (charAt == 122) {
return 97; // z -> a
@Arkar-Aung
Arkar-Aung / Makeup
Last active August 29, 2015 14:14 — forked from Trikke/Makeup
package trikke.gists;
import android.graphics.Typeface;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.BackgroundColorSpan;
import android.text.style.ForegroundColorSpan;
import android.text.style.RelativeSizeSpan;
import android.text.style.StrikethroughSpan;
import android.text.style.StyleSpan;
-module (calculator).
-export ([exponential/2, multiply/2]).
multiply(_, 0) -> 1;
multiply(Num, 1) -> Num;
multiply(Num, Exp) -> Num + multiply(Num, Exp-1).
exponential(_, 0) -> 1;
exponential(Base, 1) -> Base;
exponential(_, Exp) when(Exp < 0) -> throw("Bad argument");
@Arkar-Aung
Arkar-Aung / calculator.erl
Last active August 29, 2015 14:10
Solve calculating exponential in functional way without using loop, built-in multiply (*) and exponential function.
-module (calculator).
-export ([exponential/2, multiply/2]).
exponential(_, Exp) when(Exp < 0) ->
throw("Bad argument");
exponential(Num, Exp) when (Exp > 0) ->
calc_exponential(Num, Num, Exp).
calc_exponential(_, _, 0) ->