Skip to content

Instantly share code, notes, and snippets.

View diyfr's full-sized avatar

Stéphane diyfr

  • Nantes, FR
View GitHub Profile
@matusnovak
matusnovak / README.md
Last active December 10, 2024 19:26
Matrix (Synapse + Riot) in Docker with Traefik and federation

Matrix

matrix.org chat is split into two parts, the server and the client. The server we are going to use is called Synapse and the client is Riot.im. The Synapse will also need Postgres database and Redis for caching.

0. Folders

Make sure your folder structure looks like this.

example/
@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
@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>;
@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;
@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,
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active November 13, 2024 05:31
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.




@JamesMessinger
JamesMessinger / IndexedDB101.js
Last active November 24, 2024 17:09
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"});
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" ],