Skip to content

Instantly share code, notes, and snippets.

View reline's full-sized avatar
🌈

Nathan Reline reline

🌈
View GitHub Profile
function githubFeed($user) { // string param for GitHub username
$.ajax({
type: "GET",
url: "http://cors.io/?u=https://github.com/" + $user + ".atom",
cache: false,
dataType: 'xml',
success: function(result) {
console.log($user + ".atom loaded");
var atom = $("<span />", { html: result.firstChild }).text();
@reline
reline / myProject.sublime-project
Last active September 29, 2016 15:41
Sublime workspace for Visual Studio project
{
"folders":
[
{
"path": ".",
"folder_exclude_patterns": [".svn", "._d", ".metadata", ".settings", ".git", "*Debug"],
"file_exclude_patterns": ["*.pyc", "*.pyo", ".project"]
}
],
"build_systems":
function gitlabFeed($privateToken) {
$.ajax({
type: "GET",
url: "http://cors.io/?u=https://gitlab.com/dashboard/projects.atom?private_token=" + $privateToken,
cache: false,
dataType: 'xml',
success: function(result) {
console.log("projects.atom loaded");
var feed = $("<div>",{html: result.firstChild});
@reline
reline / server.php
Created July 16, 2016 01:27
Everything you need to know about your server
<?php
echo "PHP_SELF: " . $_SERVER['PHP_SELF'];
echo "<br>";
echo "GATEWAY_INTERFACE: " . $_SERVER['GATEWAY_INTERFACE'];
echo "<br>";
echo "SERVER_ADDR: " . $_SERVER['SERVER_ADDR'];
echo "<br>";
echo "SERVER_NAME: " . $_SERVER['SERVER_NAME'];
echo "<br>";
echo "SERVER_SOFTWARE: " . $_SERVER['SERVER_SOFTWARE'];
@reline
reline / Android.gitignore
Last active January 30, 2017 01:38
Android gitignore
# IntelliJ IDEA
.idea
*.iml
annotations
classes
captures
projectFilesBackup
# Generated
bin
@reline
reline / FragmentManagerActivity.java
Last active November 30, 2016 14:43
Android Fragment Manager - SDK 16+
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
public class MyActivity extends AppCompactActivity {
private static final String FRAGMENT_ONE = "FRAGMENT_ONE";
private static final String FRAGMENT_TWO = "FRAGMENT_TWO";
@reline
reline / ControllerManager.java
Last active May 30, 2017 19:30
A controller manager for the Conductor library
import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.util.SparseArray;
import android.view.ViewGroup;
import com.bluelinelabs.conductor.Controller;
import com.bluelinelabs.conductor.Router;
import com.bluelinelabs.conductor.RouterTransaction;
@reline
reline / ConditionalTimeoutIdlingResource.java
Created January 17, 2017 19:08
Espresso Idling Resource that waits until either a certain condition is met or a given time has passed
import android.support.test.espresso.IdlingResource;
public class ConditionalTimeoutIdlingResource implements IdlingResource {
private final long startTime;
private final long waitingTime;
private ResourceCallback resourceCallback;
private ConditionalResourceCallback conditionalResourceCallback = new ConditionalResourceCallback() {
@Override
public boolean meetsCondition() {
@reline
reline / AsyncGeocoder.java
Last active April 18, 2021 02:14
Async RxAndroid wrapper for Android's Geocoder
import android.content.Context;
import android.location.Address;
import android.location.Geocoder;
import java.io.IOException;
import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
@reline
reline / CustomTrust.java
Last active August 24, 2022 12:45
Trusting self-signed certificates in Android using OkHttp
import okhttp3.*;
import okio.Buffer;
import javax.net.ssl.*;
import java.io.IOException;
import java.io.InputStream;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;