Skip to content

Instantly share code, notes, and snippets.

View Antarix's full-sized avatar

Antarix Antarix

View GitHub Profile
@Antarix
Antarix / ApiCall.java
Last active September 2, 2016 12:28
Helper class for OkHttp http://square.github.io/okhttp/
import android.util.Log;
import org.json.JSONObject;
import java.io.IOException;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.RequestBody;
import okhttp3.Response;
@Antarix
Antarix / iOS_open_settings_cheatsheet.md
Last active October 28, 2020 20:43
iOS cheat sheet for opening specific phone setting from application

Cheat sheet for opening specific setting from your application

Swift

UIApplication.sharedApplication().openURL(NSURL(string:"prefs:root=General")!)

Objective-C

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=General"]];
@Antarix
Antarix / git-feature-workflow.md
Created March 29, 2016 06:35 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow

There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.

The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.

When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].

Basic branching

When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.

@Antarix
Antarix / SearchableAdapter.java
Created February 26, 2016 07:42 — forked from fjfish/SearchableAdapter.java
Simple String Adapter for Android ListView that has a filter that gives whatever it finds and ignores word boundaries
package com.yourco.yourapp;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
@Antarix
Antarix / LagTracker.java
Created October 20, 2015 06:25
A simple class that can track how long code takes to execute.
import android.util.Log;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* @author Aidan Follestad (afollestad)
*/
public class LagTracker {
@Antarix
Antarix / Imaging.php
Last active November 24, 2016 09:10
Create thumbnail of image while uploading
<?php
class Imaging
{
// Variables
private $img_input;
private $img_output;
private $img_src;
private $format;
@Antarix
Antarix / MultiPartUtility.java
Created October 13, 2015 08:38
Uploading Multiple files at once with Post and Header parameter in Android
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;

Show hidden files

defaults write com.apple.finder AppleShowAllFiles YES

Hide hidden files

defaults write com.apple.finder AppleShowAllFiles NO

@Antarix
Antarix / Android Studio .gitignore
Last active November 24, 2016 09:12 — forked from iainconnor/Android Studio .gitignore
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@Antarix
Antarix / OpacityHex.txt
Last active August 29, 2015 14:27
Opacity hex color code.
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
60% — 99
55% — 8C