Skip to content

Instantly share code, notes, and snippets.

View letroll's full-sized avatar

Julien Quiévreux letroll

View GitHub Profile
@letroll
letroll / script.sh
Created August 7, 2017 15:21
[run command with specific user] run a command with a specific user #run #command #user #bash #shell #unix
sudo -H -u otheruser bash -c 'echo "I am $USER, with uid $UID"'
@letroll
letroll / export.sh
Created August 1, 2017 14:08
[add bin in path] add bin in path #path #unix #shell
export PATH=$PATH:~/opt/node/bin
@letroll
letroll / gist:54ecddfc7752c90afc148235f87d90e7
Last active July 5, 2017 15:30
[get android project dependencies] lister les dépendances gradle de l'application #android #gradle
https://blog.mindorks.com/avoiding-conflicts-in-android-gradle-dependencies-28e4200ca235
gradle -q dependencies your-app-project:dependencies
gradlew :app:dependencies
gradlew :app:dependencie
gradlew :app:androidDependencies
configurations.all {
resolutionStrategy {
@letroll
letroll / paginate.java
Last active July 5, 2017 15:27
[pagination avec rxjava] pagination avec rxjava #android #rxjava #rx
private void downloadDataWhenDiscussionUnresolved(String numPage) {
Observable<Discussions> operationObservable = getDiscussionsObservable(numPage);
operationObservable.subscribe(new Subscriber<Discussions>() {
@Override
public void onCompleted() {
Log.d(TAG, "onCompleted() called");
}
@Override
@letroll
letroll / CurlLoggingInterceptor.java
Last active July 5, 2017 15:39 — forked from jgilfelt/CurlLoggingInterceptor.java
[OkHttp interceptor logs requests as curl commands] An OkHttp interceptor that logs requests as curl shell commands #android #okhttp #curl #unix #request
/*
* Copyright (C) 2016 Jeff Gilfelt.
*
* 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
@letroll
letroll / gist:a12b7067ed042be8f98c
Last active July 5, 2017 15:40 — forked from DomGries/gist:3786466
[event bus csharp] event bus csharp #eventbus
using System;
using System.Collections.Generic;
public class GameEvent
{
}
public class EventMessenger
{
@letroll
letroll / gist:b06704340947b8d140dd
Last active July 6, 2017 11:37
[gradle android signinConfigs] gradle android signinConfigs #gradle #android #signature
signingConfigs {
release
}
defaultConfig {
signingConfig signingConfigs.release
}
def Properties props = new Properties()
def homePath = System.properties['user.home']
@letroll
letroll / increase.sh
Last active July 6, 2017 11:38
[temporarily resize tmp] temporarily resize tmp #tmp #unix #linux #partition #bash #shell
# mount -o remount,size=8G,noatime /tmp
#! /bin/bash
#=====================================================================
# Selects an android device
# Copyright (C) 2012-2013 Diego Torres Milano. All rights reserved.
#
# See:
# - http://dtmilano.blogspot.ca/2013/01/android-select-device.html
# - http://dtmilano.blogspot.ca/2012/03/selecting-adb-device.html
# for details on usage.
#=====================================================================
@letroll
letroll / .gitignore
Last active August 29, 2015 14:21
Create a global .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #