Skip to content

Instantly share code, notes, and snippets.

View IvanWooll's full-sized avatar

Ivan Wooll IvanWooll

  • Northampton UK
View GitHub Profile
import sublime, sublime_plugin, re, string
class KdcformatCommand(sublime_plugin.TextCommand):
def run(self, edit):
for region in self.view.sel():
if not region.empty():
s = self.view.substr(region)
news = s.replace('[', '[\n\t')
# -*- coding: utf-8 -*-
import re
import sublime
import sublime_plugin
class OkhttplogremoveCommand(sublime_plugin.TextCommand):
def run(self, edit):
for region in self.view.sel():
[
{
"args": null,
"command": "select_all"
},
{
"args": null,
"command": "okhttplogremove"
},
{
@FormUrlEncoded
@POST("oauth/token")
Call<AuthResponseModel> auth(
@Field("username") String username,
@Field("password") String password,
@Field("grant_type") String grant_type,
@Field("client_id") Integer client_id,
@Field(
"client_secret") String client_secret
@IvanWooll
IvanWooll / 0_reuse_code.js
Created November 5, 2015 13:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@IvanWooll
IvanWooll / AssetUtils.java
Created August 27, 2015 21:54
work in progress class for copying files from asset folder
package theappdevelopers.ocrreceiptscanner;
import android.content.Context;
import android.content.res.AssetManager;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@IvanWooll
IvanWooll / NetworkStateProvider.java
Created August 5, 2015 20:50
Android utility class for checking device's network connectivity and type.
package theappdevelopers.networkutilstest.utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**
* Created by ivanwooll on 05/08/15.
*/
@IvanWooll
IvanWooll / gist:8cd8eb5fea9de4dbb1a2
Last active August 29, 2015 14:06
Sample call using Koushik Duttas Ion library with a JsonObject as the returned data object
Ion.with(mContext)
.load("GET", "http:.....")
.setLogging("get collection feed item", Log.VERBOSE)
.setHeader("Authorization", "Bearer " + mAccessToken)
.asJsonObject()
.setCallback(new FutureCallback<JsonObject>() {
@Override
public void onCompleted(Exception e, JsonObject result) {
if(e == null){