Skip to content

Instantly share code, notes, and snippets.

View GitEliteNovice's full-sized avatar
:octocat:
Having Fun

Aryan Dhankar GitEliteNovice

:octocat:
Having Fun
View GitHub Profile
private void sendGetRequestForEmail(String urlString, String accessToken) throws Exception {
URL url = new URL(urlString);
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Authorization", "Bearer " + accessToken);
con.setRequestProperty("cache-control", "no-cache");
con.setRequestProperty("X-Restli-Protocol-Version", "2.0.0");
BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));
StringBuilder jsonString = new StringBuilder();
String line;
val pendingIntent: PendingIntent =
Intent(this, ExampleActivity::class.java).let { notificationIntent ->
PendingIntent.getActivity(this, 0, notificationIntent, 0)
}
val notification: Notification = Notification.Builder(this, CHANNEL_DEFAULT_IMPORTANCE)
.setContentTitle(getText(R.string.notification_title))
.setContentText(getText(R.string.notification_message))
.setSmallIcon(R.drawable.icon)
@GitEliteNovice
GitEliteNovice / repo-reset.md
Created June 8, 2021 05:24 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A