Skip to content

Instantly share code, notes, and snippets.

cmoulton / Simple Alamofire Calls in Swift 4
Last active December 8, 2020 09:29
Simple Alamofire Calls in Swift 4
View Simple Alamofire Calls in Swift 4
import Alamofire
func makeGetCallWithAlamofire() {
let todoEndpoint: String = ""
.responseJSON { response in
// check for errors
guard response.result.error == nil else {
// got an error in getting the data, need to handle it
print("error calling GET on /todos/1")
muhammad-naderi /
Last active November 7, 2020 09:36
a quick Context wraper to change locale of android app in runtime, supporting changes in direction (RTL <-> LTR)
import android.annotation.TargetApi;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.res.Configuration;
import android.os.Build;
import java.util.Locale;
subfuzion /
Last active May 30, 2023 22:53
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

import android.content.Context;
import android.telephony.TelephonyManager;
* Check device's network connectivity and speed
* @author emil
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date
View gist:1885435

1. Clone your fork:

git clone

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://
git fetch upstream