Skip to content

Instantly share code, notes, and snippets.

View mediavrog's full-sized avatar

Maik B mediavrog

  • @shackersNFT
  • Germany / Japan
View GitHub Profile
@mediavrog
mediavrog / dotmatrixforntlink
Created April 7, 2014 05:09
Nice Dot Matrix font
@mediavrog
mediavrog / .bash_profile
Created April 7, 2014 09:22
Improved shell for github
export ANDROID_HOME=/Applications/AndroidStudio.app/sdk
export PATH=$HOME/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH
source git-completion.bash
# add current git branch to prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="\[\033[00m\]\u@\h\[\033[01;34m\] \W \[\033[31m\]\$(parse_git_branch) \[\033[00m\]$\[\033[00m\] "
@mediavrog
mediavrog / JapaneseCharacter.java
Last active August 26, 2020 09:03
Simple string conversion from Hiragana to Katakana and vice versa. Uses the JapaneseCharacter class from Duane J. May and combines it with a simple Utility class method to perform the actual conversion.
/**
* JapaneseCharacter contains static functions to do various tests
* on characters to determine if it is one of the various types of
* characters used in the japanese writing system.
* <p/>
* There are also a functions to translate between Katakana, Hiragana,
* and Romaji.
*
* @author Duane J. May <djmay@mayhoo.com>
* @version $Id: JapaneseCharacter.java,v 1.2 2002/04/20 18:10:24 djmay Exp $
@mediavrog
mediavrog / EditText.xml
Created June 4, 2014 02:27
Cursor not visible in EditText in Jelly Bean - this happens if you set a background for the field; to fix it, set the cursorDrawable to @null. Always use this combination when using custom backgrounds.
<EditText
android:id="@+id/my_edit_text"
...
android:background="@drawable/some_bg"
android:textCursorDrawable="@null" />
@mediavrog
mediavrog / build.gradle
Created July 15, 2014 04:59
Simple gradle build file for legacy structure library projects
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}
@mediavrog
mediavrog / build.gradle
Created July 16, 2014 09:25
Evernote library build.gradle file
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}
// Create the Global class in your /app folder root package:
import play.api.{GlobalSettings, Play}
import play.api.Play.current
import play.api.mvc._
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
/**
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)
package es.cloudey.pagespeed.util;
import java.util.HashMap;
import java.util.Map;
import android.os.Bundle;
import android.os.Parcelable;
public class CollectionUtils {
public static Bundle toBundle(Map<String, ? extends Parcelable> input) {
@mediavrog
mediavrog / bound_greeting.js
Created February 10, 2015 08:29
JS bound greeting
/*
* Assuming we have some object with properties and methods
*/
var me = {
first_name: 'Ahikar',
last_name: 'Grilka',
race: 'Klingon',
email: 'AhikarGrilka@jourrapide.com',
occupation: 'Commander of Defence',
greet: function(other_person){