Skip to content

Instantly share code, notes, and snippets.

task clean(type: Delete) {
delete rootProject.buildDir
}
val clean by tasks.creating(Delete::class) {
delete(rootProject.buildDir)
}
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.1.3")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlinVersion}")
}
}
include(":app")
import android.graphics.Bitmap
import timber.log.Timber
/**
* Picasso transformation to Crop an image from top.
* Created by Gaurav Vashisth on 20/10/17.
*/
class CropFromTopTransformation constructor(private val cropDistance: Int): com.squareup.picasso.Transformation {
@vashisthg
vashisthg / node-and-npm-in-30-seconds.sh
Created August 30, 2016 15:24 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh

Keybase proof

I hereby claim:

  • I am vashisthg on github.
  • I am vashisthg (https://keybase.io/vashisthg) on keybase.
  • I have a public key whose fingerprint is 685A 72B0 A842 2EE5 3BDD 2DC8 626B 541A DA1F 142D

To claim this, I am signing this object: