Skip to content

Instantly share code, notes, and snippets.

@lmedinas
lmedinas / gist:d62450ac0a98d0b9555b
Last active September 15, 2015 20:55
Get facebook albums URL using Android SDK 4.x
GraphRequest request = GraphRequest.newMeRequest(
loginResult.getAccessToken(),
new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(
JSONObject object,
GraphResponse response) {
// Application code
JSONObject json = response.getJSONObject();
if (json != null) {
@lmedinas
lmedinas / execsh.swift
Created June 27, 2015 22:19
Execute shell commands in swift 2.0
// Credit goes to http://stackoverflow.com/a/26400656/1651253
func execcmd(cmdname: String) -> NSString
{
var outstr = ""
let task = NSTask()
task.launchPath = "/bin/sh"
task.arguments = ["-c", cmdname]
let pipe = NSPipe()
task.standardOutput = pipe
### Keybase proof
I hereby claim:
* I am lmedinas on github.
* I am lmedinas (https://keybase.io/lmedinas) on keybase.
* I have a public key whose fingerprint is C737 81D7 C8DE 0F32 2C77 E99A DEFC DC01 E06A AB68
To claim this, I am signing this object: