Skip to content

Instantly share code, notes, and snippets.

Vadim Kotov vkotovv

Block or report user

Report or block vkotovv

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View broken-image-repairer.md

Broken Image Repairer

What is the problem?

A long time ago, it was possible to inline images from all kinds of external sources. Since the switch from HTTP to HTTPS, this is no longer possible; only HTTPS sources are allowed. This leads to ugly blurbs like

alt text http://example.com/image.png

instead of a nicely formatted page with images. Sometimes, the links don't even work anymore, even with HTTPS images, which will show like this: ... Luckily, we have the Wayback Machine which is able to rescue some of the lost images. Since a picture often says more than a thousand words, it's important to bring back the post into its original state; important enough to justify the occasional bump of an old post (see below).

@giansalex
giansalex / digitalocean-promo-cupon-code-free-trial.md
Created Apr 6, 2018
DigitalOcean Coupon Code $35 / $100 1 Year Free Trial - April 2018
View digitalocean-promo-cupon-code-free-trial.md

alt text

Digital Ocean Promo Coupon Code $35 / $100 1 Year Free Trial

1) Get $35 / $25 / $20 / $10 free DigitalOcean Credit.

2) Get DigitalOcean 1 Year Free Trial.

3) Get $100 Credit For 60 Days. $100 Free Credits

@darnmason
darnmason / SwipeView.kt
Last active Jul 29, 2019
A custom Android ViewGroup that contains a single child and allows you to swipe it to the left, with a callback once the swipe is complete. For example to dismiss a view. Works well in a LinearLayout with animateLayoutChanges=true when setting the SwipeView visibility to GONE on swipe.
View SwipeView.kt
import android.content.Context
import android.support.v4.view.ViewCompat
import android.support.v4.widget.ViewDragHelper
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.View
import android.widget.FrameLayout
class SwipeView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : FrameLayout(context, attrs, defStyleAttr) {
@aqua30
aqua30 / HideShowScrollParallaxActivity.java
Last active Sep 4, 2019
Show/Hide view on up/down scroll in android - Using ScrollView
View HideShowScrollParallaxActivity.java
/**
* 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
Jenkins Pipeline: How to get the status of the previous build
View jenkinsfile.groovy
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 Sep 12, 2019
Run Cisco Webex on 64-bit Ubuntu 16.04
View webex-ubuntu.md

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 Jul 2, 2019
How to edit a commit with interactive rebase
View gist:ca6ac68b174a047b5ccde3930c8568dc

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

@jonico
jonico / Jenkinsfile
Last active Sep 16, 2019
Example for a full blown Jenkins pipeline script with 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, stage timeouts, stage c…
View Jenkinsfile
#!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-alpine
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active Sep 12, 2019
Jenkinsfile idiosynchrasies with escaping and quotes
View Jenkinsfile.groovy
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@paulocaldeira17
paulocaldeira17 / AppBarStateChangeListener.java
Last active Aug 27, 2019
Android AppBarLayout collapsed/expanded state listener
View AppBarStateChangeListener.java
import android.support.design.widget.AppBarLayout;
/**
* App bar collapsing state
* @author Paulo Caldeira <paulo.caldeira@acin.pt>.
*/
public abstract class AppBarStateChangeListener implements AppBarLayout.OnOffsetChangedListener {
// State
public enum State {
EXPANDED,
You can’t perform that action at this time.