Skip to content

Instantly share code, notes, and snippets.

View gierschv's full-sized avatar

Vincent Giersch gierschv

View GitHub Profile
@gierschv
gierschv / hello-world.midi
Last active May 11, 2018 10:00
Import MIDI file (Python 3)
@gierschv
gierschv / create-score-python-3.py
Created May 11, 2018 09:04
Create score (python 3)
from pprint import pprint
import os
import urllib.request, urllib.error
import flat_api
from flat_api.rest import ApiException
SCORE_TO_IMPORT='https://gist.githubusercontent.com/gierschv/938479bec2bbe8c39eebbc9e19d027a0/raw/2caa4fa312184412d0d544feb361f918869ceaa5/hello-world.xml'
configuration = flat_api.Configuration()
<?php
require_once(__DIR__ . '/vendor/autoload.php');
date_default_timezone_set('Europe/Paris');
// Configure OAuth2 access token
$config = Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken($_ENV['FLAT_ACCESS_TOKEN']);
$api_instance = new Flat\APIClient\Api\AccountApi(null, $config);
var EMBED_APP_ID = '';
var container = document.getElementById('embed-container');
var embed = new Flat.Embed(container, {
embedParams: {
appId: EMBED_APP_ID,
mode: 'edit',
layout: 'track'
}
});
@gierschv
gierschv / what-forces-layout.md
Created October 14, 2017 21:08 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@gierschv
gierschv / embed.html
Created April 27, 2017 10:22
Flat Embed JavaScript Demo - Custom & AutoPlay
<div id="embed-container"></div>
<script src="https://cdn.jsdelivr.net/flat-embed/0.2.0/embed.min.js"></script>
<script>
var embed = new Flat.Embed('embed-container', {
embedParams: {
appId: '<your-app-id>',
branding: false,
controlsFloating: false,
themeControlsBackground: '#B71C1C',
@gierschv
gierschv / hello-world.xml
Created April 9, 2017 16:30
MusicXML - Hello World
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE score-partwise PUBLIC
"-//Recordare//DTD MusicXML 3.0 Partwise//EN"
"http://www.musicxml.org/dtds/partwise.dtd">
<score-partwise version="3.0">
<part-list>
<score-part id="P1">
<part-name>Music</part-name>
</score-part>
</part-list>
@gierschv
gierschv / ssh-agent.sh
Created April 1, 2017 22:15
Config SSH Agent OSX
SSH_AGENT_CACHE=$HOME/.ssh-agent
if [ -s "${SSH_AGENT_CACHE}" ] ; then
echo "Reusing existing ssh-agent"
eval `cat "${SSH_AGENT_CACHE}"`
ps -fp ${SSH_AGENT_PID} | grep -q ssh-agent
if [ $? -eq 1 ] ; then
echo "ssh-agent pid ${SSH_AGENT_PID} no longer running"
rm -f "${SSH_AGENT_CACHE}"
fi
fi

Keybase proof

I hereby claim:

  • I am gierschv on github.
  • I am giersch (https://keybase.io/giersch) on keybase.
  • I have a public key ASCm9bMM318s_G295ApSzsWM_R97p3zDOOv6fTDFj6Pruwo

To claim this, I am signing this object:

@gierschv
gierschv / share.js
Created November 5, 2015 15:09
Share with Classroom Bookmark
javascript:window.open('https://classroom.google.com/share?url='+encodeURIComponent(window.location))