Skip to content

Instantly share code, notes, and snippets.

View severak's full-sized avatar

Mikoláš Štrajt severak

View GitHub Profile
@potomak
potomak / FacebookL.jpg
Last active November 15, 2017 11:01
The daily routine
FacebookL.jpg
@rbnpi
rbnpi / GlassArmonicaPlaysMozart.rb
Last active August 27, 2022 18:47
Glass Armonica for Sonic Pi plays Mozart UPDATED to use rpitch: (introduced after this was first written) to calculate sample rate. MUCH simpler
#a Glass Armonica "voice" for Sonic Pi by Robin Newman November 2014
# revised to use rpitch 2018; corrected 2022 for missing tr function
#This simulates the Glass Armonica invented by Benjamin Franklin and for which Mozart
#composed the piece played here
#This version uses rpitch: parameter added to Sonic Pi after the original was written in 2014
##| sample :ambi_glass_rub
##| play :fs5
##| puts note(:fs5)
##| stop
use_debug false
@fiznool
fiznool / hashid.js
Created November 16, 2014 09:45
Short 'hash' ID generator.
'use strict';
/**
* The default alphabet is 25 numbers and lowercase letters.
* Any numbers that look like letters and vice versa are removed:
* 1 l, 0 o.
* Also the following letters are not present, to prevent any
* expletives: cfhistu
*/
var ALPHABET =
@nixta
nixta / .htaccess
Last active December 28, 2024 20:15
.htaccess to add CORS to your website
# Add these three lines to CORSify your server for everyone.
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE"
Header set Access-Control-Allow-Headers "Content-Type, Authorization"
@mgreensmith
mgreensmith / Slack_solarized_themes
Last active March 17, 2025 14:33
Solarized themes for Slack
Solarized
#FDF6E3,#EEE8D5,#93A1A1,#FDF6E3,#EEE8D5,#657B83,#2AA198,#DC322F
Solarized Dark
#073642,#002B36,#B58900,#FDF6E3,#CB4B16,#FDF6E3,#2AA198,#DC322F
@treyhunner
treyhunner / findccalbums.py
Last active March 19, 2019 00:07
Scour music subreddits for Creative Commons-licensed music on Bandcamp, SoundCloud, and Vimeo
"""Print CC-licensed music from the last month"""
import json
import requests
banned_strings = [
"blemmed.com",
"cuterthanpie.com",
"youtu",
@geerlingguy
geerlingguy / crawler_detect.php
Created May 7, 2014 18:48
Detect crawlers/bots/spiders in PHP (simple and fast)
<?php
/**
* Check if the given user agent string is one of a crawler, spider, or bot.
*
* @param string $user_agent
* A user agent string (e.g. Googlebot/2.1 (+http://www.google.com/bot.html))
*
* @return bool
* TRUE if the user agent is a bot, FALSE if not.
/*
-----------------------------------
Emoji - natural display for the web
-----------------------------------
These font face definitions allows to display emoji glyphs intermingled with
arbitrary characters outside emoji unicode blocks.
Usage
@gruber
gruber / Liberal Regex Pattern for Web URLs
Last active March 28, 2025 11:24
Liberal, Accurate Regex Pattern for Matching Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "example.com". For a pattern that attempts to
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502
# Single-line version:
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s
@mhseiden
mhseiden / download_decode_downsample.js
Last active March 23, 2021 09:19
Downloading, Decoding, and Downsampling an Audio File with the WebAudio API
/**
* In this gist, assume that we're using Chrome, and the following variables are in scope and have already been assigned to the following:
*
* var url = "http://upload.wikimedia.org/wikipedia/commons/b/be/Toccata_et_Fugue_BWV565.ogg";
* var webaudio = new webkitAudioContext();
* var renderCallback = function renderCallback(data) { return "render!"; } // a function which will render the given audio data on a canvas
*/
// Fetch the data with an AJAX request
var xhr = new XMLHttpRequest();