Skip to content

Instantly share code, notes, and snippets.

View cerw's full-sized avatar
💭
helm

Petr Cervenka cerw

💭
helm
View GitHub Profile
@rbnpi
rbnpi / ReadMe.md
Last active December 3, 2022 17:03
Sonic Pi Loop Controller. Updated for Sonic Pi versions 3.31 and later This program arose out of a question on in-thread.sonic-pi.net inquiring how to control switching a live_loop on and off via a push button see https://in-thread.sonic-pi.net/t/osc-loop-machine-makeymakey/850 See video at https://youtu.be/cEz-fOEF3M0

NOW UPDATED TO INCLUDE CONTROL OF THE BACKGROUND PULSE AND SCREEEN BOTH PROGRAM AND TOUCHOSC TEMPLATE CHANGED

USE SPloopController4.rb for SP versions 3.31, or 4 or greater. YOu can use the new version of TouchOSC see later in the ReadMe file. A SEPARATE VERSION TUNED FOR Pi3 IS ALSO INCLUDED The original question was concerned with using mekey-makey as the "switch input" source. Here I have used a TouchOSC template with 11 pushbuttons on it as the input source. To make it more interesting, I also drive a large "LED" on the TouchOSC screen with OSC commands from the Sonic Pi program. The program has been streamlined to use just ONE live loop to detect the switches being pushed,

@socheatsok78
socheatsok78 / README.md
Last active March 29, 2019 03:18
PWA with Laravel Mix, Webpack and Service Worker caching strategies
@brianclogan
brianclogan / horizon-authorization-example.md
Created August 2, 2017 02:43
Laravel Horizon - Authorizing Access via IP Addresses on Production Environments

So, with Laravel Horizon here, I ventured to use it. I found something though, it is possible, but VERY difficult to get the current user in the App Service Provider.

I set out a different route, using IP Addresses.

Since our office has a static IP, I modified the following:

.env - Adding the remote addresses as a JSON encoded array to a new variable

REMOTE_ADDRESSES='["xxx.xxx.xxx.xxx"]'
@agramajo
agramajo / slack_xymon.py
Last active March 23, 2019 03:27
Xymon slack integration
import os
import json
import urllib2
url = 'https://hooks.slack.com/services/COMPLETE_ENDPOINT_HERE'
channel = '#servers'
server = os.environ.get('BBHOSTNAME')
color = os.environ.get('BBCOLORLEVEL')
msg = os.environ.get('BBALPHAMSG')
@belsrc
belsrc / gist:672b75d1f89a9a5c192c
Last active April 15, 2023 15:13
Simple Vue.js filters that I usually need
/**
* Changes value to past tense.
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc.
* http://jsfiddle.net/bryan_k/0xczme2r/
*
* @param {String} value The value string.
*/
Vue.filter('past-tense', function(value) {
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing
var vowels = ['a', 'e', 'i', 'o', 'u'];
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p
#EXTINF:-1,BBC - Radio 2
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p
#EXTINF:-1,BBC - Radio 3
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls
#EXTINF:-1,BBC - Radio 4
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p
#EXTINF:-1,BBC - Radio 5 live
@uggedal
uggedal / nginx.conf
Created May 28, 2013 17:28
Multiple location match in nginx
location ~ ^/(.*)/(.*)/other/stuff/(.*)/this-is-static {
location /static-cache {
# root/alias or other config here
}
try_files /static-cache/$1/$2/$3/this-is-static @app;
}
# or
location ~ ^/(.*)/(.*)/other/stuff/(.*)/this-is-static {