View sanic_logging_workaround.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from sanic import Sanic | |
# `configure_logging=False` will stop Sanic's default logging. You'll use print() for printing to stdout | |
app = Sanic(name="MyApp", configure_logging=False) | |
@app.middleware('request') | |
async def embed_start_time(request): | |
request.ctx.start_time = time.time() # Use requst context `request.ctx` to embed extra information | |
View indonesia_infection_simulation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run this with python 3 | |
# no external dependencies needed | |
import random | |
# initial number of case | |
initial_case = 2 | |
# number of carrier | |
carrier = 2 | |
# number of infected |
View .vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set encoding=utf-8 | |
set nocompatible " required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" let Vundle manage Vundle, required | |
Plugin 'gmarik/Vundle.vim' |
View initialize.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="prism-widget"></div> | |
<script src="https://prismapp-files.s3.amazonaws.com/widget/prism.js"></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() { |
View mothernature_default.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mothernature import Environment | |
env = Environment("someyml.yaml", environment='DEV') | |
test_env.get("DB_CONNECTION") |
View mothernature_env.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
test_env.get("DB_CONNECTION") |
View config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COMMON: | |
DEBUG: false | |
TESTING: false | |
IS_PRODUCTION: False | |
TEST: | |
TESTING: true | |
DEVELOPMENT: | |
DEBUG: true | |
TESTING: false | |
STAGING: |
View build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fill this with the name of your app in gradle settings | |
evaluationDependsOn(':app') | |
ext.androidProject = 'app' | |
apply plugin: 'cobertura' | |
apply plugin: 'com.kageiit.robojava' | |
cobertura { | |
coverageFormats = ['html', 'xml'] | |
coverageIgnoreTrivial = true | |
coverageIgnores = ['org.slf4j.Logger.*'] |
View build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 21 | |
buildToolsVersion "21.1.1" | |
defaultConfig { | |
applicationId "com.emfeld.mvptest" | |
minSdkVersion 15 | |
targetSdkVersion 21 |
View build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:1.0.0' | |
// 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") { |
NewerOlder