Skip to content

Instantly share code, notes, and snippets.

View devisnik's full-sized avatar

Volker Leck devisnik

  • Berlin, Germany
View GitHub Profile
@ttscoff
ttscoff / dontforget.bash
Last active June 12, 2024 21:04
Quick reminders from Terminal (bash)
#!/bin/bash
# dontforget
#
# A stupid script for short term reminders in bash
#
# Arguments just need to contain a number and a bunch of words.
#
# The number can be anywhere in the arguments, but there shouldn't
# be any other numeric digits.
#
@mauvm
mauvm / Jasmine-and-Babel6.md
Created November 12, 2015 10:51
Jasmine ES6 run script for use with Babel 6
$ npm install --save babel-cli babel-preset-es2015
$ npm install --save-dev jasmine

.babelrc:

{
 "presets": ["es2015"]
@Ghedeon
Ghedeon / filter_devices.groovy
Created July 22, 2015 12:40
Android Gradle (1.3.0-beta4). Filter multiple devices
project.afterEvaluate {
project.("connectedDebugAndroidTest").doFirst {
def originalProvider = deviceProvider
deviceProvider = [
getName : { originalProvider.getName() },
init : { originalProvider.init() },
terminate : { originalProvider.terminate() },
getDevices : { filterDevices(originalProvider.getDevices()) },
getTimeoutInMs: { originalProvider.getTimeoutInMs() },
isConfigured : { originalProvider.isConfigured() },
@marc0der
marc0der / versions.groovy
Last active August 29, 2015 14:23
Add all versions of Groovy on BinTray to GVM/SDKman
@Grab('com.github.groovy-wslite:groovy-wslite:1.1.2')
import wslite.rest.*
def consumerKey = "CONSUMER_KEY"
def consumerToken = "CONSUMER_TOKEN"
def host = "https://bintray.com"
def client = new RESTClient(host)
def releaseClient = new RESTClient("https://gvm-vendor-dev.herokuapp.com")
@chiquitinxx
chiquitinxx / gist:2a89987fe4e611803a7b
Last active August 29, 2015 14:22
Create a Rest API fake in Groovy, using javascript npm modules (faker and json-server)
import org.grooscript.asts.GsNative
class Faker {
private _faker
@GsNative
private faker() {/*
if (!this._faker) {
this._faker = require('faker');
}
@melix
melix / gitzip.gradle
Created March 12, 2015 13:01
Create a zip file that only includes files in Git
task srcZip(type:Zip) {
appendix = 'gitsources'
from project.projectDir
doFirst {
Set excludeList = [relativePath(archivePath).toString()]
def p = "git status --ignored --porcelain .".execute([], project.projectDir)
def writer = new StringWriter()
p.consumeProcessOutput(writer, null)
@bryanstern
bryanstern / OkHttpStack.java
Last active April 24, 2022 03:17
An OkHttp backed HttpStack for Volley
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Circle Internet Financial
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@JakeWharton
JakeWharton / AutoGson.java
Last active November 28, 2021 12:32
A Gson TypeAdapterFactory which allows serialization of @autovalue types. Apache 2 licensed.
import com.google.auto.value.AutoValue;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization.
* <p>
@dmarcato
dmarcato / strip_play_services.gradle
Last active December 21, 2022 10:10
Gradle task to strip unused packages on Google Play Services library
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active March 15, 2024 06:39
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* 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