Skip to content

Instantly share code, notes, and snippets.

View johngorithm's full-sized avatar
🏠
Working from home

Johngorithm johngorithm

🏠
Working from home
View GitHub Profile
@johngorithm
johngorithm / shadow.xml
Created September 15, 2019 14:27 — forked from lecho/shadow.xml
Android shadow drawable xml.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- Drop Shadow Stack -->
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"

To undo a commit and return the changes back to staging. Use the command blow

git reset --soft HEAD^

To remove staged file staging with Git, follow the link below

Stack Overflow

The link below show how one can change a repository's remote link from the command line.

This is essentially important when switching form either HTTPS TO SSH or vice-versa

Learn More

To view all files in your project that are ignored by Git without looking into .gitignore file, run the command below

git ls-files --others --ignored --exclude-standard
import android.content.Context;
import java.io.File;
public class CacheManager {
/**
* Private Constructor to make this a Utility class.
*/
private CacheManager() {
// Private constructor

Description

Cherry picking in Git means to choose a commit from one branch and apply it onto another. This is in contrast with other ways such as merge and rebase which normally apply many commits onto another branch.

Usage

Make sure you are on the branch you want to apply the commit to.

git checkout master

@Test
public void testTeachersAreDisplayed() throws IOException {
/**
* Setting up mockWebServer at localhost:9900.
*/
MockWebServer server = new MockWebServer();
// start the server at port 9900
server.start(9900);
/**
package com.jxw.graphql;
import android.support.test.InstrumentationRegistry;
import android.support.test.espresso.IdlingRegistry;
import android.support.test.espresso.idling.CountingIdlingResource;
import android.support.test.runner.AndroidJUnit4;
import android.support.test.rule.ActivityTestRule;
import com.jxw.graphql.test_utils.TestDemoApplication;
package com.jxw.graphql.test_utils;
import android.app.Application;
import android.content.Context;
import android.support.test.runner.AndroidJUnitRunner;
public class CustomTestRunner extends AndroidJUnitRunner {
@Override
public Application newApplication(ClassLoader cl, String className, Context context) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
return super.newApplication(cl, TestDemoApplication.class.getName(), context);