Skip to content

Instantly share code, notes, and snippets.

View RankoR's full-sized avatar
🏠
Working from home

Artem Smirnov RankoR

🏠
Working from home
View GitHub Profile
@f2prateek
f2prateek / CustomView.java
Last active June 11, 2018 02:57
Event Bus in view
public class CustomView extends View {
private final Bus bus;
public CustomView(Bus bus, ....) {
super(....);
this.bus = bus;
}
@Override protected void onAttachedToWindow() {
@RankoR
RankoR / Snackbars.kt
Created November 6, 2018 16:08
Extend Espresso to make Snackbar testing easier. Note: this code works only for AndroidX.
import androidx.annotation.StringRes
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.ViewInteraction
import androidx.test.espresso.matcher.ViewMatchers
import org.hamcrest.CoreMatchers
import org.hamcrest.CoreMatchers.allOf
fun onSnackbar(@StringRes withText: Int): ViewInteraction {
return onView(
CoreMatchers.allOf(
@tarolandia
tarolandia / placeholder-color.sass
Created April 22, 2013 12:33
Sass: mixin that let you change placeholder font color.
@mixin placeholder-color($color) {
&::-webkit-input-placeholder { /* WebKit browsers */
color: $color;
}
&:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: $color;
}
&::-moz-placeholder { /* Mozilla Firefox 19+ */
color: $color;
}
@RankoR
RankoR / .screenrc
Last active May 7, 2022 21:59
.screenrc
altscreen on
term screen-256color
hardstatus off
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
startup_message off
termcapinfo xterm* ti@:te@
@PeterAttardo
PeterAttardo / Shadow.java
Last active May 12, 2022 08:13
Android Shadow Drawing
package com.example.util.shadow;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.GradientDrawable;
import android.view.View;
import static android.graphics.drawable.GradientDrawable.Orientation.LEFT_RIGHT;
import static android.graphics.drawable.GradientDrawable.Orientation.TOP_BOTTOM;
set encoding=utf-8
set mouse=
set tabstop=4
set shiftwidth=4
set expandtab
set number
syntax on
set et
@omarmiatello
omarmiatello / ParcelableUtil.java
Last active January 28, 2023 01:24
Parcelable to byte array, byte array to parcelable
/**
* Copyright 2013 Omar Miatello - omar.miatello@justonetouch.it
* Based on http://stackoverflow.com/a/18000094/1228545
*
* 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
*
@nickbutcher
nickbutcher / IconView.kt
Last active July 30, 2023 22:05
A prototype implementation of a shadow effect inspired by the Google Play Games app (https://play.google.com/store/apps/details?id=com.google.android.play.games).
/*
* Copyright 2017 Google Inc.
*
* 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 distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

Build tensorflow on OSX with NVIDIA CUDA support (GPU acceleration)

These instructions are based on Mistobaan's gist but expanded and updated to work with the latest tensorflow OSX CUDA PR.

Requirements

OS X 10.10 (Yosemite) or newer

@juliendargelos
juliendargelos / imagemagick-trim-transparent.sh
Last active October 23, 2023 02:31
Imagemagick command that trims transparent pixels from an image.
convert input.png -trim +repage output.png