Skip to content

Instantly share code, notes, and snippets.

View jvanderwee's full-sized avatar
🐙

Joseph Van der Wee jvanderwee

🐙
View GitHub Profile
@jvanderwee
jvanderwee / retrospectively_apply_gitignore.txt
Created July 4, 2018 14:51
Retrospectively apply .gitignore
git rm -r --cached .
git add .
git commit -m "Retrospectively applied gitignore"
@jvanderwee
jvanderwee / delete_merged_remote_branches.txt
Created November 16, 2016 14:09
Delete merged remote branches
git branch -r --merged | grep -v master | sed 's/origin\///' | xargs -n 1 git push --delete origin
@jvanderwee
jvanderwee / HomeTimeline.java
Created August 16, 2016 19:26
Twitter Android SDK Home Timeline
package com.twitter.sdk.android.tweetui;
import com.twitter.sdk.android.core.Callback;
import com.twitter.sdk.android.core.TwitterCore;
import com.twitter.sdk.android.core.models.Tweet;
import java.util.List;
import retrofit2.Call;
@jvanderwee
jvanderwee / delete_merged_local_branches.txt
Last active November 16, 2016 14:06
Deleted merged local branches
git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d
watch -n30 "xdotool search --onlyvisible --class "Chrome" windowfocus key ctrl+Tab ctrl+R"
@jvanderwee
jvanderwee / YouTubeHelper.java
Created August 5, 2015 16:39
Extract video id from YouTube url in java
import com.google.inject.Singleton;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Singleton
public class YouTubeHelper {
final String youTubeUrlRegEx = "^(https?)?(://)?(www.)?(m.)?((youtube.com)|(youtu.be))/";
final String[] videoIdRegex = { "\\?vi?=([^&]*)","watch\\?.*v=([^&]*)", "(?:embed|vi?)/([^/?]*)", "^([A-Za-z0-9\\-]*)"};
@jvanderwee
jvanderwee / ZAPI.java
Last active May 13, 2019 09:05
Java helper class for calling ZAPI
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URL;
import java.util.ArrayList;