Skip to content

Instantly share code, notes, and snippets.

Fauzan Erich Emmerling femmerling

Block or report user

Report or block femmerling

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .vimrc
set encoding=utf-8
set nocompatible " required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
call vundle#end() " required
filetype plugin indent on " required
femmerling / initialize.html
Last active Apr 3, 2017
Prism Widget Initialization Script
View initialize.html
<div id="prism-widget"></div>
<script src=""></script>
<script type="text/javascript">
(function(e, b, c) {
e.Shamu = {
merchant_id: '',
initialize: function(a) {
a.merchant_id ? this.merchant_id = a.merchant_id : console.log("Shamu: Please initialize Shamu with a merchat_id");
display: function() {
femmerling /
Created Jun 18, 2016
Example of MotherNature using default environment
from mothernature import Environment
env = Environment("someyml.yaml", environment='DEV')
femmerling /
Created Jun 18, 2016
MotherNature Example without default variable
from mothernature import Environment
env = Environment("config.yml")
# This will provide the config based on the environment you set when starting the application
# and then you can do
femmerling / config.yml
Created Jun 18, 2016
Example Yaml file for MotherNature use
View config.yml
DEBUG: false
TESTING: false
DEBUG: true
TESTING: false
femmerling / build.gradle
Created Jan 29, 2015
Test module build.gradle
View build.gradle
// fill this with the name of your app in gradle settings
ext.androidProject = 'app'
apply plugin: 'cobertura'
apply plugin: 'com.kageiit.robojava'
cobertura {
coverageFormats = ['html', 'xml']
coverageIgnoreTrivial = true
coverageIgnores = ['org.slf4j.Logger.*']
View build.gradle
apply plugin: ''
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.emfeld.mvptest"
minSdkVersion 15
targetSdkVersion 21
femmerling / build.gradle
Created Jan 29, 2015
project root build.gradle
View build.gradle
buildscript {
repositories {
dependencies {
classpath ''
// this is the robojava plugin
classpath 'com.kageiit:robojava-plugin:1.+'
// this is for cobertura so you have test coverage check
classpath("net.saliman:gradle-cobertura-plugin:2.2.5") {
femmerling /
Created Jan 22, 2014
Have problems checking class variable type to ensure that value will be typecasted accordingly
def parser(passed_object, request_data):
for item in request_data.values:
if hasattr(passed_object, item) and request_data.values.get(item) != None:
inputval = request_data.values.get(item)
#TODO: check the corresponding class variable type before typecasting
setattr(passed_object, item, inputval)
return passed_object
femmerling /
Created Oct 11, 2013
Function to simplify json parsing for SQLAlchemy model creation
I know that parsing json values for SQLAlchemy models is a pain in the ass.
The following two helpers will get you cleaner code and handles the json while converting it into code.
This is commonly use in Flask-SQLAlchemy applications. My latest backyard release already included these functions
import json
# this import is just an example of an SQLAlchemy module, it can be any model that you wish to use
from app.models import User
You can’t perform that action at this time.