Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Johngorithm johngorithm

🎯
Focusing
Block or report user

Report or block johngorithm

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
@johngorithm
johngorithm / shadow.xml
Created Sep 15, 2019 — forked from lecho/shadow.xml
Android shadow drawable xml.
View shadow.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"
View undo_git_commit.md

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

git reset --soft HEAD^

View git_change_remote_url.md

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

View git_ignore.md

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
View ClearCacheInAndroid.java
import android.content.Context;
import java.io.File;
public class CacheManager {
/**
* Private Constructor to make this a Utility class.
*/
private CacheManager() {
// Private constructor
View git_cherry_pick.md

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

View MainActivityTestSection.java
@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);
/**
View MainActivityTest.java
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;
View CustomTestRunner.java
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);
You can’t perform that action at this time.