Skip to content

Instantly share code, notes, and snippets.

@Tagakov
Tagakov / Di.kt
Last active January 16, 2020 15:15
template for adding new controller to DI graph
typealias YourController = ListEditorController
//do not forget to rename component and module
//do not forget to add module to parent component
//do not forget to add HasControllerInjector to parent entity [Application, Activity, Controller] if not present
@Subcomponent(modules = [ComponentModule::class])
interface RenameMeComponent : AndroidInjector<YourController> {
@Subcomponent.Builder
abstract class Builder : AndroidInjector.Builder<YourController>()
@aqua30
aqua30 / HideShowScrollParallaxActivity.java
Last active April 29, 2024 20:02
Show/Hide view on up/down scroll in android - Using ScrollView
/**
* Created by Saurabh(aqua) in 2017.
*/
public class ScrollActivity extends BaseActivity {
/* view binding */
@BindView(R.id.scrollView)ScrollView scrollView;
@BindView(R.id.parallax_image)ImageView parallaxImage;
@BindView(R.id.tv_perhour)TextView textView;
@refactorsaurusrex
refactorsaurusrex / jenkinsfile.groovy
Created May 22, 2017 23:07
Jenkins Pipeline: How to get the status of the previous build
node('whatever') {
stage('blah') {
echo currentBuild.getPreviousBuild().result
}
}
// ref: https://support.cloudbees.com/hc/en-us/articles/217591038-How-to-Iterate-Through-the-Last-Successful-Builds-in-Pipeline-Job
@mshkrebtan
mshkrebtan / webex-ubuntu.md
Last active October 28, 2022 15:23
Run Cisco Webex on 64-bit Ubuntu 16.04

Run Cisco Webex on 64-bit Ubuntu 16.04

With Audio and Screen Sharing Enabled

Enable support for 32-bit executables

Add the i386 architecture to the list of dpkg architectures :

sudo dpkg --add-architecture i386
@bkemper
bkemper / gist:ca6ac68b174a047b5ccde3930c8568dc
Last active December 7, 2021 19:28
How to edit a commit with interactive rebase

While on a branch with a couple of commits, you can edit a commit with interactive rebase. This should be used sparingly and only on branches and never on master.

  1. Checkout the branch

$ git checkout my-branch

  1. Get the ref of the commit that you want to edit from the commit log. (e.g. 67b191fc62eda52b5b208cc4de50df7144a03171)

$ git log

@Robyer
Robyer / maven-publish-helper-usage.gradle
Last active June 15, 2023 04:22
Gradle script for publishing Android library with sources and javadoc to Maven repository using maven-publish plugin.
// You can use maven-publish-helper.gradle script without changes and even share it between multiple
// modules. Just place the maven-publish-helper.gradle file in the root directory of your project,
// then apply it at the bottom of your module's build.gradle file like this:
// ...content of module's build.gradle file...
apply from: '../maven-publish-helper.gradle'
publishing {
publications {
@jonico
jonico / Jenkinsfile
Last active January 31, 2024 09:43
Example for a full blown Jenkins pipeline script with CodeQL analysis steps, multiple stages, Kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, …
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8
@gortok
gortok / pre-receive.py
Last active June 8, 2020 12:39
Python Pre Receive hook for checking commit messages
#!/bin/python
import sys
import re
import subprocess
#Format: "oldref newref branch"
line = sys.stdin.read()
(base, commit, ref) = line.strip().split()
new_branch_push = re.match(r'[^1-9]+', base)
@shrikant0013
shrikant0013 / GestureMediaPlayerActivity.java
Created November 4, 2016 04:55
Android example for code that needs to change settings (Manifest.permission.WRITE_SETTINGS), targetSdkVersion >= 23
/**
* Created by spandhare on 11/3/16.
*/
import com.malmstein.fenster.controller.FensterPlayerControllerVisibilityListener;
import com.malmstein.fenster.play.FensterVideoFragment;
import android.Manifest;
import android.content.Intent;
import android.net.Uri;