Skip to content

Instantly share code, notes, and snippets.

View ApiCall.java
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 Oct 28, 2020
iOS cheat sheet for opening specific phone setting from application
View iOS_open_settings_cheatsheet.md

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 Mar 29, 2016 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow
View git-feature-workflow.md

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 Feb 26, 2016 — forked from fjfish/SearchableAdapter.java
Simple String Adapter for Android ListView that has a filter that gives whatever it finds and ignores word boundaries
View SearchableAdapter.java
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 Oct 20, 2015
A simple class that can track how long code takes to execute.
View LagTracker.java
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 Nov 24, 2016
Create thumbnail of image while uploading
View Imaging.php
<?php
class Imaging
{
// Variables
private $img_input;
private $img_output;
private $img_src;
private $format;
@Antarix
Antarix / MultiPartUtility.java
Created Oct 13, 2015
Uploading Multiple files at once with Post and Header parameter in Android
View MultiPartUtility.java
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;
View Mac Commands.md

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 Nov 24, 2016 — forked from iainconnor/Android Studio .gitignore
A .gitignore for use in Android Studio
View Android Studio .gitignore
# 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 Aug 29, 2015
Opacity hex color code.
View OpacityHex.txt
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
60% — 99
55% — 8C