Skip to content

Instantly share code, notes, and snippets.

View romainpiel's full-sized avatar

Romain Piel romainpiel

  • Toulouse, France
  • 15:07 (UTC +02:00)
View GitHub Profile
dependencies {
classpath 'com.github.castorflex.manifestreplace:plugin:1.0.0'
}
apply plugin: 'com.android.application'
apply plugin: 'manifestreplace'
manifestReplace {
manifestPlaceholders = [
activities : [
@romainpiel
romainpiel / dabblet.css
Created April 17, 2012 16:06
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
import android.util.Log;
import com.squareup.okhttp.Headers;
import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import com.squareup.okhttp.ResponseBody;
import org.threeten.bp.Clock;
@romainpiel
romainpiel / gist:5047214
Created February 27, 2013 11:19
Vitamio MediaMetaRetriever error log
02-27 12:17:19.646: DEBUG/dalvikvm(1950): GC_FOR_ALLOC freed 130K, 8% free 10764K/11608K, paused 76ms, total 76ms
02-27 12:17:19.646: INFO/dalvikvm-heap(1950): Grow heap (frag case) to 10.690MB for 161110-byte allocation
02-27 12:17:19.666: DEBUG/dalvikvm(1950): GC_FOR_ALLOC freed 77K, 8% free 10843K/11768K, paused 14ms, total 14ms
02-27 12:17:20.667: DEBUG/overlay(159): Unset pipe=VG0 dpy=0; Unset pipe=VG1 dpy=0; Unset pipe=RGB1 dpy=0;
02-27 12:17:21.558: DEBUG/overlay(159): Set pipe=RGB1 dpy=0; Set pipe=VG0 dpy=0; Set pipe=VG1 dpy=0;
02-27 12:17:23.901: DEBUG/AndroidRuntime(4936): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
02-27 12:17:23.901: DEBUG/AndroidRuntime(4936): CheckJNI is OFF
02-27 12:17:23.911: DEBUG/dalvikvm(4936): Trying to load lib libjavacore.so 0x0
02-27 12:17:23.911: DEBUG/dalvikvm(4936): Added shared lib libjavacore.so 0x0
02-27 12:17:23.921: DEBUG/dalvikvm(4936): Trying to load lib libnativehelper.so 0x0
@romainpiel
romainpiel / DatabaseUtils.java
Created April 4, 2013 13:13
DatabaseUtils.InsertHelper backup
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@romainpiel
romainpiel / convertLocalizable.rb
Last active December 18, 2015 21:49 — forked from florianmski/convertLocalizable.rb
iOS localizable to Android xml String resource converter
#!/usr/bin/ruby
# based on https://github.com/tmurakam/cashflow/blob/0a01ac9e0350dfb04979986444244f8daf4cb5a8/android/convertStrings.rb
# support comments and Converter such as "%@", "%d", "%0.1f"...
# in your directory : ./main.rb Localizable.strings
file = File.open("strings.xml", "w");
file.puts "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
file.puts "<resources>"
{
"log_in" : "Log In",
"logging_in" : "Logging in...",
"username" : "Username",
"password" : "Password",
"account" : "Account",
"home" : "Home",
"messages" : "Messages",
"notifications" : "Notifications",
@romainpiel
romainpiel / run.sh
Last active December 26, 2015 05:09
Create a new bash run configuration on Android Studio based on that script to speed up the running process
#!/bin/sh
./gradlew installDebug --parallel --daemon
adb shell am start -n com.packagename.app/.MainActivity
# tell ls to be colourful
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
# tell grep to highlight matches
export GREP_OPTIONS='--color=auto'
# alias
alias ls='ls -FGal'
# set custom bash prompt
export PS1="\[\e[00;33m\]\u\[\e[0m\]\[\e[00;37m\]:\[\e[0m\]\[\e[00;36m\]\W\[\e[0m\]\[\e[00;37m\] \[\e[0m\]"