Skip to content

Instantly share code, notes, and snippets.

@rye761
rye761 / array.c
Last active August 17, 2016 04:51
Not sure why this doesn't cause an error.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const *argv[]) {
int *my_array = malloc(sizeof(int));
my_array[0] = 3;
my_array[1] = 4;
printf("%d, %d\n", my_array[0], my_array[1]);
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.github.scribejava:scribejava-core:2.7.3'
compile 'com.google.code.gson:gson:2.7'
compile files('src/main/java/libs/Unsplash-Java-Unofficial.jar')
}
package com.example;
import com.github.rye761.unsplash.Category;
import com.github.rye761.unsplash.Photo;
import com.github.rye761.unsplash.Stats;
import com.github.rye761.unsplash.Unsplash;
import java.util.HashMap;
public class TestOAuth {
package com.example;
import com.github.scribejava.core.builder.ServiceBuilder;
import com.github.scribejava.core.model.OAuth2AccessToken;
import com.github.scribejava.core.model.OAuthRequest;
import com.github.scribejava.core.model.Response;
import com.github.scribejava.core.model.Verb;
import com.github.scribejava.core.oauth.OAuth20Service;
import java.io.IOException;
decl String:newName[100];
newName = StrCat("Mr. ", 100, GetClientName(client));
SetClientInfo(client, "name", newName);
@rye761
rye761 / gist:6247072
Created August 16, 2013 03:30
MySQL query wrong :(
$query = "SELECT * FROM `users` WHERE sid64 = :sid64";
$query_params = array(
':sid64' => $sid64
);
try {
$stmt = $db->prepare($query);
$result = $stmt->execute($query_params);
} catch (PDOException $ex) {
return ("Conversion Failed!");
}