Skip to content

Instantly share code, notes, and snippets.

View fschrofner's full-sized avatar

Florian Schrofner fschrofner

View GitHub Profile
@ahulyk
ahulyk / AppComponen.kt
Last active August 19, 2020 11:41
Glide 4 inject custom OkHttp client using Dagger 2
@Singleton
@Component(
modules = [
NetModule::class,
AndroidInjectionModule::class,
GlideBuilderModule::class
]
)
interface AppComponent : AndroidInjector<App> {
@imiric
imiric / xclip
Created August 31, 2017 18:59
xclip for Cygwin/MSYS2
#!/bin/bash
# This replicates xclip functionality used by pass in Cygwin/MSYS2
# Original author: https://tylor.io/2015/07/13/password-manager/
while [[ $# > 0 ]]
do
key="$1"
case $key in
-o|-out)
@timrijckaert
timrijckaert / GravitySnapHelper.java
Created October 4, 2016 21:51
A snap helper that has a notion of Gravity and will snap accordingly
package be.tim.rijckaert.snaprecyclerview;
import android.graphics.PointF;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.LinearSnapHelper;
import android.support.v7.widget.OrientationHelper;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.LayoutManager;
@lopspower
lopspower / README.md
Last active July 15, 2024 18:36
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@beradrian
beradrian / setproxy
Last active October 10, 2022 17:12
Set proxy for npm and git
# set a proxy
set HTTP_PROXY=
set HTTPS_PROXY=%HTTP_PROXY%
npm config set proxy %HTTP_PROXY%
npm config set https.proxy %HTTPS_PROXY%
npm config set https-proxy %HTTPS_PROXY%
git config --global http.proxy %HTTP_PROXY%
git config --global https.proxy %HTTPS_PROXY%
# unset proxy
@liyuhao
liyuhao / gist:cddee42332695d894255
Last active November 29, 2016 21:24 — forked from jansanchez/gist:ce5b0ca1c5e538f4b266
How to install NVIDIA video drivers in Elementary OS
@tmaeda
tmaeda / gitbucket.service
Created May 3, 2015 04:19
/etc/systemd/system/gitbucket.service
[Unit]
Description=Git hosting service
[Service]
User=gitbucket
ExecStart=/usr/bin/java -jar /home/gitbucket/gitbucket.war --port=xxxx --host=127.0.0.1 --gitbucket.home=/home/gitbucket/repo
[Install]
WantedBy=multi-user.target
Android Emulator usage: emulator [options] [-qemu args]
options:
-sysdir <dir> search for system disk images in <dir>
-system <file> read initial system image from <file>
-datadir <dir> write user data into <dir>
-kernel <file> use specific emulated kernel
-ramdisk <file> ramdisk image (default <system>/ramdisk.img
-image <file> obsolete, use -system <file> instead
-initdata <file> same as '-init-data <file>'
-data <file> data image (default <datadir>/userdata-qemu.img
@gabrielemariotti
gabrielemariotti / mobile-AndroidManifest.xml
Last active September 15, 2020 11:33
Android Wear: small gist to start an Activity on the mobile handheld from the Android Wear device.
<service android:name=".ListenerServiceFromWear">
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
</intent-filter>
</service>