Skip to content

Instantly share code, notes, and snippets.

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:

@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
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 {
include(":app")
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.1.3")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlinVersion}")
}
}
val clean by tasks.creating(Delete::class) {
delete(rootProject.buildDir)
}
task clean(type: Delete) {
delete rootProject.buildDir
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), file("proguard-rules.pro"))
}
}
object Libraries {
object Kotlin {
val stdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${Versions.kotlinVersion}"
}
object Support {
val appcompatV7 = "com.android.support:appcompat-v7:28.0.0-alpha3"
}
object Tests {
object Libraries {
object Kotlin {
val stdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${Versions.kotlinVersion}"
}
object Support {
val appcompatV7 = "com.android.support:appcompat-v7:28.0.0-alpha3"
}
object Tests {