Skip to content

Instantly share code, notes, and snippets.

@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!");
}
decl String:newName[100];
newName = StrCat("Mr. ", 100, GetClientName(client));
SetClientInfo(client, "name", newName);
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;
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 {
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')
}
@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]);
@rye761
rye761 / animation.html
Created June 19, 2017 19:22
Vue.js Animation
<html>
<head>
<title>Vue.js Animations</title>
<script src="https://unpkg.com/vue"></script>
<style>
* {
font-family: sans-serif;
}
h1 {
display: inline-block;
<html>
<head>
<title>Todo App</title>
<meta charset="utf-8">
<script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="app">
<h1>{{ header }}</h1>
<todo-form @add-todo="addTodo"></todo-form>
@rye761
rye761 / todoapp.html
Created June 24, 2017 02:50
Todo App in Vue.js
<html>
<head>
<title>Todo App</title>
<meta charset="utf-8">
<script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="app">
<h1>Todo App</h1>
<todo-form @todo-created="addTodo"></todo-form>
<html>
<head>
<title>Vue.js Router</title>
<meta charset="utf-8">
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-router@2.7.0/dist/vue-router.js"></script>
</head>
<body>
<div id="app">
<nav>