Skip to content

Instantly share code, notes, and snippets.

View vdurmont's full-sized avatar

Vincent Durmont vdurmont

View GitHub Profile
@vdurmont
vdurmont / config.json
Created November 26, 2013 19:25
database config for a mongodb-based app
{
"host": "localhost",
"dbname": "example"
}
@vdurmont
vdurmont / bug.json
Created November 26, 2013 19:26
model example
{
"id": 42,
"title": "Wrong format for the creation date",
"creation": "2013-11-27T04:33:35Z",
"status": "OPEN",
"assignee": "Vincent"
}
@vdurmont
vdurmont / gist.rb
Created January 6, 2014 20:28 — forked from gsong/gist.rb
require 'cgi'
require 'open-uri'
# Require the ActiveSupport::Cache module
require 'active_support/cache'
module Fiftyfive
module Liquid
class GistTag < ::Liquid::Tag
def initialize(tag_name, gist_ref, tokens)
@vdurmont
vdurmont / Main.java
Created January 7, 2014 18:45
First use of APIPixie
// Create an APIPixie instance
APIPixie pixie = new APIPixie("http://api.mydistantservice.com");
// Retrieve an APIService for your object
APIService<Message> msgService = pixie.getService(Message.class);
// Start communicating with the distant API
Message msg = msgService.get(42L);
// Now do stuff with the object!
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else {
root.Hello = factory();
}
}(this, function() {
return function() {
var done = false;
return {
@vdurmont
vdurmont / jsonp-callback.html
Last active August 29, 2015 14:06
How to use JSONP with userinfo.io API
<!DOCTYPE html>
<html lang="en">
<head>
<title>UserInfo.io — JSONP callback</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript">
function userinfoCallback(data) {
console.log("I can now do awesome things with this beautiful data I just received!");