Skip to content

Instantly share code, notes, and snippets.


Jane Ullah janoulle

View GitHub Profile
jschroed91 /
Last active Oct 3, 2020
Install openSSH 7.6 on Ubuntu 14.04
echo "Installing deps..."
sudo apt-get install libssl-dev zlib1g-dev libpam0g-dev xz-utils
sudo apt-get remove openssh-server
echo "Downloading and extracting sources..."
tar -xf openssh-7.6p1.tar.gz
brunodles / gist:badaa6de2ad3a84138d517795f15efc7
Last active Jul 27, 2020
This is a test to show how to use expresso to check if a toast was displayed.
View gist:badaa6de2ad3a84138d517795f15efc7
package com.github.brunodles.toastespresso;
import android.test.suitebuilder.annotation.LargeTest;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
swankjesse /
Last active Dec 30, 2020
This OkHttp application interceptor will replace the destination hostname in the request URL.
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
/** An interceptor that allows runtime changes to the URL hostname. */
public final class HostSelectionInterceptor implements Interceptor {
private volatile String host;
devilelephant / AWS4Signer.groovy
Last active Oct 21, 2019
Java/Groovy example of using Amazon AWS AWS4Signer class to sign requests (in our case elasticsearch calls)
View AWS4Signer.groovy
import com.amazonaws.DefaultRequest
import com.amazonaws.SignableRequest
import com.amazonaws.auth.AWS4Signer
import com.amazonaws.auth.AWSCredentialsProvider
import com.amazonaws.http.HttpMethodName
import groovy.util.logging.Slf4j
import org.apache.http.client.utils.URLEncodedUtils
import org.springframework.http.HttpHeaders

1. Store api keys in a xml file

Put xml file "api_keys.xml" in the directory "res/value/".


<?xml version="1.0" encoding="utf-8"?>
    <string name="THE_MOVIE_DB_API_TOKEN">XXXXX</string>
patik /
Last active Jan 18, 2021
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

stuart-marks /
Created Apr 8, 2014
Dynamic filtering using Java 8 streams.
import java.util.*;
import java.util.function.*;
import static*;
import static java.util.Comparator.*;
jvns /
Last active Jan 7, 2021
A list of questions you could ask while interviewing

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

mikeal / gist:7724521
Last active Dec 29, 2015
Inclusive by Exclusion
View gist:7724521

When you build a community you're creating a culture. That culture will be about more than the code, the modules, or the language. The people you draw in will have their own biases and behaviors that impact the kinds of people you continue to draw as you grow.

Cultures will naturally fight behavior that is divisive. That is, behavior that is divisive to the established members of that community. As a community grows larger it is harder and harder to change what the culture finds acceptable because changing it, even if it is inclusive in nature, is disturbing and divisive to existing membership. Fighting for change in established cultures means dealing with a lot of dismissive language and attacks for the "tone" of your argument.

That is why it is so important that a culture becomes comfortable with aggressively fighting exclusionary behavior. While it is certainly more beneficial to make pro-active steps to increase diversity we cannot be dismissive of the effect that passionate reactions to poor behavior

You can’t perform that action at this time.