Skip to content

Instantly share code, notes, and snippets.

View danieleds's full-sized avatar

Daniel Di Sarli danieleds

View GitHub Profile
@danieleds
danieleds / overlays.js
Last active November 9, 2021 10:20
Custom Overlays in Video SDK
function addCustomOverlaySupport(roomSession, rootElement) {
let currLayout = null
const overlays = {}
rootElement.style.position = 'relative'
function adjustOverlayPosition(overlayEl, memberId) {
if (!currLayout) return
const layer = currLayout.layers.find(lyr => lyr.member_id === memberId)
@danieleds
danieleds / fft.py
Last active March 13, 2017 21:27
Example of a fast fourier transformation plot in Python 3
import numpy as np
import math
import matplotlib.pyplot as plt
# sample: sampled data
# result: fft output
def plot(sample, result, sample_rate):
plt.figure(1)
a = plt.subplot(211)
@danieleds
danieleds / zenburn.css
Last active October 17, 2016 23:57
ZenBurn CodeMirror theme for Notepadqq
/**
* Zenburn color palette from the Emacs Zenburn Theme
* https://github.com/bbatsov/zenburn-emacs/blob/master/zenburn-theme.el
*
* Thanks to https://github.com/wisenomad/zenburn-lighttable-theme
*/
/*
Default color.
In .clj files this matches var names, ex. the 'v' in (def v 3) .
@danieleds
danieleds / gist:326903084a196055a7c3
Created September 4, 2014 08:48
CodeMirror: indent with tab or spaces
editor.addKeyMap({
"Tab": function (cm) {
if (cm.somethingSelected()) {
var sel = editor.getSelection("\n");
// Indent only if there are multiple lines selected, or if the selection spans a full line
if (sel.length > 0 && (sel.indexOf("\n") > -1 || sel.length === cm.getLine(cm.getCursor().line).length)) {
cm.indentSelection("add");
return;
}
}