Skip to content

Instantly share code, notes, and snippets.

Quentin DOMMERC dommerq

View GitHub Profile
@dommerq
dommerq / gist:4a70b440c952436b3fea03f7ec8e9e07
Created Aug 7, 2016 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1
View gist:4a70b440c952436b3fea03f7ec8e9e07

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@dommerq
dommerq / screen.sh
Created Aug 7, 2015
Take screenshot with demo mode on Android
View screen.sh
#!/bin/bash
adb=your/android/sdk/path/platform-tools/adb
folder=.
$adb shell am broadcast -a com.android.systemui.demo --es command enter
$adb shell am broadcast -a com.android.systemui.demo --es command clock --es hhmm 0520
$adb shell am broadcast -a com.android.systemui.demo --es command battery --es level 100 --es plugged false
$adb shell am broadcast -a com.android.systemui.demo --es command network \
--es mobile show \
--es fully true \
@dommerq
dommerq / share package names
Last active Aug 29, 2015
All share package names I could find. Tell me about others.
View share package names
String[] twitter = new String[] {
"com.klinker.android.twitter_l",
"org.mariotaku.twidere",
"com.levelup.touiteur",
"jp.r246.twicca",
"com.jv.materialfalcon",
"com.twitter.android",
"com.handmark.tweetcaster",
"it.mvilla.android.fenix",
"com.handmark.tweetcaster.premium",
View falcon_pro_sqlite
08-06 17:28:09.528: E/SQLiteLog(26897): (14) cannot open file at line 30191 of [00bb9c9ce4]
08-06 17:28:09.528: E/SQLiteLog(26897): (14) os_unix.c:30191: (24) open(/data/data/com.jv.falcon.pro/databases/tweets.db-journal) -
08-06 17:28:09.528: E/SQLiteLog(26897): (14) cannot open file at line 30191 of [00bb9c9ce4]
08-06 17:28:09.528: E/SQLiteLog(26897): (14) os_unix.c:30191: (24) open(/data/data/com.jv.falcon.pro/databases/tweets.db-journal) -
08-06 17:28:09.528: E/SQLiteLog(26897): (14) statement aborts at 156: [SELECT * FROM tweets WHERE (user = "kentin_dommerc" AND mention= 0 AND dm= 0 ) AND (pubdate > 1375716489534 AND content IS NULL AND img LIKE 'http%' AND (( fromUser = ? ) OR fav = 1))
08-06 17:28:09.528: E/SQLiteQuery(26897): exception: unable to open database file (code 14); query: SELECT * FROM tweets WHERE (user = "kentin_dommerc" AND mention= 0 AND dm= 0 ) AND (pubdate > 1375716489534 AND content IS NULL AND img LIKE 'http%' AND (( fromUser = ? ) OR fav = 1)) ORDER BY pubdate DESC LIMIT 200
08-
View gist:5869658
06-26 19:50:19.241: E/AndroidRuntime(19949): FATAL EXCEPTION: main
06-26 19:50:19.241: E/AndroidRuntime(19949): java.lang.IllegalStateException: No tab known for tag null
06-26 19:50:19.241: E/AndroidRuntime(19949): at android.support.v4.app.FragmentTabHost.doTabChanged(FragmentTabHost.java:326)
06-26 19:50:19.241: E/AndroidRuntime(19949): at android.support.v4.app.FragmentTabHost.onAttachedToWindow(FragmentTabHost.java:276)
06-26 19:50:19.241: E/AndroidRuntime(19949): at android.view.View.dispatchAttachedToWindow(View.java:11944)
06-26 19:50:19.241: E/AndroidRuntime(19949): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2415)
06-26 19:50:19.241: E/AndroidRuntime(19949): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2422)
06-26 19:50:19.241: E/AndroidRuntime(19949): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2422)
06-26 19:50:19.241: E/AndroidRuntime(19949): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2422)
06-26 19:50
View gist:5869621
package com.pariscope.ui.activities;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.os.Bundle;
import android.support.v4.app.FragmentTabHost;
import com.google.android.gms.maps.GoogleMap;
View gist:5869606
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
View gist:5812245
06-19 09:14:19.848: W/System.err(14551): 410:
06-19 09:14:19.848: W/System.err(14551): message - The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.
06-19 09:14:19.848: W/System.err(14551): code - 68
06-19 09:14:19.858: W/System.err(14551): Relevant discussions can be found on the Internet at:
06-19 09:14:19.858: W/System.err(14551): http://www.google.co.jp/search?q=682bc9ef or
06-19 09:14:19.858: W/System.err(14551): http://www.google.co.jp/search?q=0922a44f
06-19 09:14:19.858: W/System.err(14551): TwitterException{exceptionCode=[682bc9ef-0922a44f], statusCode=410, message=The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview., code=68, retryAfter=-1, rateLimitStatus=null, version=3.0.3}
06-19 09:14:19.858: W/System.err(14551): at twitter4j.internal.http.HttpClientImpl.request(SourceFile:177)
06-19 09:14:19.858: W/System.err(14551): at twitter4j.internal.http.HttpClientWra
View gist:5772016
public class ContactFragment extends Fragment{
private ListView contactLV;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(com.quentindommerc.flatme.R.layout.f_contact, container);
contactLV = (ListView)v.findViewById(R.id.contactLV);
ContactListViewAdapter adapter = new ContactListViewAdapter(getActivity());
View gist:5771892
<?xml version="1.0" encoding="utf-8"?>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/contactLV"
android:layout_width="match_parent"
android:footerDividersEnabled="false"
android:layout_height="match_parent"
android:divider="@color/orange_dark_salmon"
android:dividerHeight="0.5dp" >
</ListView>
You can’t perform that action at this time.