Skip to content

Instantly share code, notes, and snippets.

@elsewhat
elsewhat / SonicPiMidiController
Last active January 9, 2021 20:52
Midi controller script for Sonic Pi
# Midi controller script for Sonic Pi
# by elsewhat
####### CONFIG #########
#Configuration parameters based on actual midi controller
#Find by viewing cues event-stream
minKeyIndex= 52
maxKeyIndex = 72
minKnobIndex =1
maxKnobIndex =8
/* CSS classes required
.sapMNavItem.bouvetMNavItemBottom {
-webkit-transition-property: -webkit-transform;
-webkit-transform: translate3d(0px, 100%, 0px);
transform: translate3d(0px, 100%, 0px);
transition-property: transform;
}
.sapMNavItem.bouvetMNavItemTop {
-webkit-transition-property: -webkit-transform;
//Get all styles where the provided class is involved
//Input parameters should be css selector such as .myClass or #m
//returned as an array of tuples {selectorText:"", styleDefinition:""}
function getStyleWithCSSSelector(cssSelector) {
var styleSheets = window.document.styleSheets;
var styleSheetsLength = styleSheets.length;
var arStylesWithCSSSelector = [];
//in order to not find class which has the current name as prefix
function init(consumerKey, consumerSecret,scope,expiration,appName){
_authorizeToTrello(consumerKey,consumerSecret,scope,expiration,appName);
}
function _authorizeToTrello(consumerKey,consumerSecret,scope,expiration,appName) {
var oauthConfig = UrlFetchApp.addOAuthService("trello");
oauthConfig.setAccessTokenUrl("https://trello.com/1/OAuthGetAccessToken");
oauthConfig.setRequestTokenUrl("https://trello.com/1/OAuthGetRequestToken");
oauthConfig.setAuthorizationUrl("https://trello.com/1/OAuthAuthorizeToken?scope="+scope+"&expiration="+expiration+"&name="+appName);
@elsewhat
elsewhat / trello_burndown.gs
Created December 12, 2013 14:03
Google apps script for generating daily burndown chart from trello tasks. Sends it by email (set up a trigger)
//TODO in this script
//1. Add board id in url used in TrelloAPI method (line xx
//2. Add your email in sendChartsByEmail
//3. Add your Trello keys from https://trello.com/1/appKey/generate to authorizeTrello
//4. Setup daily trigger in script editor that runs TrelloAPI()
//5. Run once in google apps script editor to authorize trello for access
//6. Lookup values and aggValues are hardcoded to the labels I use in Trello
//
//In the Trello board use scrum for trello syntax (http://scrumfortrello.com/)
//Example title: <name of task> (estimate hours) [work delivered in hours]
@elsewhat
elsewhat / sapui5_sources_latest.sh
Created July 26, 2013 13:32
Get latest SAPUI5 for eclipse update site
#!/bin/bash
echo "1. Download the main file from the eclipse update site"
wget --no-check-certificate https://tools.hana.ondemand.com/juno/content.jar
echo "2. Unzip the content.jar to content.xml (and delete content.jar)"
unzip content.jar
rm content.jar
echo "3. Generate urls for the components to fetch com.sap.ui5"
@elsewhat
elsewhat / genericTileCollection
Created July 25, 2013 11:32
Generic SAPUI5 TileCollection
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="UTF-8">
<title>SAPUI5 Icon Browser</title>
<script id="sap-ui-bootstrap" type="text/javascript"
src="resources/sap-ui-core.js" data-sap-ui-theme="sap_bluecrystal"
<!DOCTYPE HTML>
<html>
<head>
<title>Tree Event</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="resources/sap-ui-core.js"
type="text/javascript"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons"
data-sap-ui-theme="sap_goldreflection">
@elsewhat
elsewhat / gist:4525762
Last active December 11, 2015 01:48
Ingress Pontifax code testing Output can be found here: https://docs.google.com/document/d/1Z2Baw94tlcoRODV_g89nOy2FgI6Dvx-vy6eV8Wpwpus/edit
// SolitaireCipher.java
// Copyright (C) 1999 Jeff Gold
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
@elsewhat
elsewhat / curl.txt
Created May 19, 2012 14:14
CURL FeedResource Output
$ curl -i http://localhost:8080/feed_stream/api/feed/
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Date: Sat, 19 May 2012 14:10:50 GMT
Server: SAP
{"feedEntry":[{"id":"1","isComment":"false","senderEmail":"dagfinn.parnas@bouvet
.no","senderName":"Dagfinn","text":"First!"},{"id":"2","isComment":"false","send
erEmail":"dagfinn.parnas@gmail.com","senderName":"Dagfinn","text":"This is an ex