Skip to content

Instantly share code, notes, and snippets.

View diyfr's full-sized avatar

Stéphane diyfr

  • Nantes, FR
View GitHub Profile
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@JamesMessinger
JamesMessinger / IndexedDB101.js
Last active May 19, 2024 18:56
Very Simple IndexedDB Example
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("MyDatabase", 1);
// Create the schema
open.onupgradeneeded = function() {
var db = open.result;
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"});
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active July 12, 2024 09:40
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@gabonator
gabonator / cc1101oregon.ino
Created May 12, 2016 21:06
Oregon scientific WMR sniffing with CC1101 transceiver using arduino
#include "cc1101.h"
class C1101Receiver : public CC1101
{
enum
{
SS = 10,
MOSI = 11,
MISO = 12,
SCK = 13,
@mbunyard
mbunyard / MockResponseInterceptor.java
Created November 18, 2016 21:11
OkHttp3 interceptor which provides a mock response from local resource file.
package com.rogerthat.network.util;
import android.content.Context;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLConnection;
import okhttp3.Interceptor;
@ccarrasc
ccarrasc / stomp-client.ts
Created March 31, 2017 12:32
Stomp client wrapped in Angular Service
import { Injectable } from '@angular/core';
import { Observable, Observer, BehaviorSubject, ReplaySubject } from 'rxjs/Rx';
import * as SockJS from 'sockjs-client';
import { Client, Frame, Stomp } from 'stompjs';
const DEFAULT_CACHE_SIZE: number = 100;
class TopicSubscription {
public subscription: any = null;
public subject: ReplaySubject<any>;
@huseyin
huseyin / scaleway.rb
Last active May 6, 2018 13:05
Scaleway API (create, start and stop server)
#!/usr/bin/env ruby
require 'json'
require 'net/https'
require 'openssl'
require 'uri'
# Scaleway => APIClass
class Scaleway
API_ENDPOINT = 'https://cp-ams1.scaleway.com'.freeze