Skip to content

Instantly share code, notes, and snippets.

View Dagothig's full-sized avatar
Partaking in hijinks

Guillaume Noël-Martel Dagothig

Partaking in hijinks
View GitHub Profile
@Dagothig
Dagothig / FastScroller
Created May 11, 2015 21:00
Fast scroller for Android recyclerView based with adjustments for sticky headers
/**
* FastScroller for RecyclerView with adjustments for sticky headers
* based off the POC from https://github.com/AndroidDeveloperLB/LollipopContactsRecyclerViewFastScroller
* the adjustments specifically target the SLiM library (https://github.com/TonicArtos/SuperSLiM)
**/
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.support.annotation.NonNull;
@Dagothig
Dagothig / ColoredPolylineOverlay
Last active February 18, 2019 23:33
Android colored polyline (uses TrailOverlay)
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Shader;
import com.google.android.gms.maps.model.LatLng;
@Dagothig
Dagothig / unprefix.ts
Last active April 4, 2016 20:35
For those times where prefixing is not your cup of tea
// Note that unprefixing elements that aren't initially defined will break them
// (which is why it conditionnally unprefixes pointerLockElement)
function unprefix(element:any, prop:string, prefixes:string[]) {
let capitalized = prop[0].toUpperCase() + prop.substring(1);
let props = prefixes.map(prefix => prefix + capitalized);
if (!element[prop]) return Object.defineProperty(element, prop, {
get: function() {
for (let prop of props) {
var val = this[prop];
if (val) return val;
@Dagothig
Dagothig / dagnotes.sty
Created September 23, 2018 18:28
Custom package pour prendre des notes
\ProvidesPackage{dagnotes}
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage[francais]{babel}
\RequirePackage{amsmath, amssymb}
\RequirePackage{setspace}
\RequirePackage[margin=1in]{geometry}
\newcommand{\formatdoc}{
\ProvidesPackage{dagnotes}
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage[francais]{babel}
\RequirePackage{amsmath, amssymb}
\RequirePackage{setspace}
\RequirePackage[margin=1in]{geometry}
\newcommand{\formatdoc}{
@Dagothig
Dagothig / index.html
Last active October 18, 2019 01:29
Nifty Fifty gallery with only html
<!DOCTYPE html>
<html lang="en">
<head>
<title>the_ocalhoun's Nifty Fifty</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="charset" content="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<style>
a {
@Dagothig
Dagothig / tp2.py
Created October 31, 2019 13:16
SHREKT TON CPU
from pyo import *
import random
import math
server = Server()
server.boot()
play_dur = 0.125
# Instrument de synthèse
# encoding: utf-8
"""
Miniature sonore à 3 voix
------------------------------------
Vous devez créer un courte musique mettant en place 3 types de processus sonores:
Une voix mélodique, de type soliste.
Une voix de basse.
@Dagothig
Dagothig / wawa.py
Created November 27, 2019 00:43
wawa
from pyo import *
class AutoWah:
def __init__(self, input, freq=8, q=20, min=0, max=8000):
self.follower = Follower(input, freq=freq, mul=max-min, add=min)
self.lowpass = Biquad(input, freq=self.follower, q=q, type=0)
self.follower.ctrl()
self.lowpass.ctrl()