Skip to content

Instantly share code, notes, and snippets.

View fxi's full-sized avatar
🚀
Learning new things.

F.Moser fxi

🚀
Learning new things.
View GitHub Profile
@rbnpi
rbnpi / bach-allabreve2-bwv589-RF.rb
Created July 27, 2023 15:50
Sonic Pi version of Bach's Allabreve. You need to use run_file "path/to/bach-allabreve2-bwv589-RF.rb" to run it. Listen to it on https://soundcloud.com/rbnsonicpi/bach-allabreve-bwv589
#bach-allabreve2-bwv589-RF.rb
#coded for Sonic Pi by Robin Newman, July 2023
use_debug false
use_synth_defaults amp: 0.5
s=0.96;r=0.04;st=0 #s,r,st = sustain factor,release factor, start tempo section
Last = 4 #pause on last note
with_fx :reverb , room: 0.9,mix: 0.7 do
use_synth :pulse
with_fx :compressor,amp: 0.7 do

Generator Functions

What are generator functions?

Generator functions are basically functions that you can pause at some point. You can define a generator function with function*:

function* Generator() {
  // code goes here
}

I like to named my generator functions with a capital, for reasons that will become apparent later, but generally they are named with a lowercase letter.

@arvati
arvati / alpine_motd_generator.md
Last active February 8, 2024 10:56 — forked from ergoz/motd_generator.sh
Dynamic motd generator for Alpine Linux (/etc/periodic/15min/motd)

Make a dynamic motd for your server

create a crond script to dynamic create an motd message to users

rc-service crond start && rc-update add crond
nano /etc/periodic/15min/motd
chmod a+x /etc/periodic/15min/motd
run-parts --test /etc/periodic/15min

Contents of /etc/periodic/15min/motd

@ww9
ww9 / one-line-text-art-and-emojis_utf8_ascii.txt
Last active May 10, 2024 02:10
Emojis, UTF8, ASCII (one line) #misc
# Collection of one line text art (◕‿◕✿)
Collection of emojis and one line text art like (╯°□°)╯︵ ┻━┻ 🤗
ּבּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
@SMUsamaShah
SMUsamaShah / List of JavaScript GUI libraries.md
Last active April 29, 2024 14:48
dat.gui alternatives to create GUI from JavaScript object

JavaScript GUI libraries

These libraries can be used to quickly create a GUI for configureable parameters using sliders, checkboxes, colors pickers etc

  1. Tweakpane https://github.com/cocopon/tweakpane Demo: https://cocopon.github.io/tweakpane/
  2. control-panel https://github.com/freeman-lab/control-panel
  3. ControlKit https://github.com/automat/controlkit.js
  4. guify https://github.com/colejd/guify Main site is down, here is the demo https://jons.website/projects/guify/index
  5. oui https://github.com/wearekuva/oui
  6. Palette.js https://github.com/lehni/palette.js
@HoldOffHunger
HoldOffHunger / bradvin.social.share.urls.txt
Last active May 14, 2024 17:23
Social Share URL's (Summary)
https://www.facebook.com/sharer.php?u={url}
https://www.facebook.com/dialog/share?app_id={app_id}&display={page_type}&href={url}&redirect_uri={redirect_url}
https://reddit.com/submit?url={url}&title={title}
https://twitter.com/intent/tweet?url={url}&text={title}&via={user_id}&hashtags={hash_tags}
https://www.linkedin.com/sharing/share-offsite/?url={url}
https://api.whatsapp.com/send?phone={phone_number}&text={title}%20{url}
https://www.tumblr.com/widgets/share/tool?canonicalUrl={url}&title={title}&caption={text}&tags={hash_tags}
http://pinterest.com/pin/create/button/?url={url}
https://www.blogger.com/blog-this.g?u={url}&n={title}&t={text}
https://www.evernote.com/clip.action?url={url}&title={title}
@zimmicz
zimmicz / server.js
Created August 6, 2017 16:25
PostGIS MVT Express routing
const express = require("express")
const app = express()
const { Pool } = require("pg")
const SphericalMercator = require("sphericalmercator")
const pool = new Pool({
host: "localhost",
port: 15432,
user: "postgres",
database: "postgres"
})
@fxi
fxi / README.md
Last active April 18, 2019 15:48
Experimental work on forked computation in shiny app using the package "parallel".

Shiny asynchronous jobs

Experiemental work on forked computation in shiny app using the package "parallel".

Does not work on windows.

Example

@gabstv
gabstv / cvwebv.sh
Last active January 12, 2019 05:57
Convert videos to HTML5 friendly video formats (mp4, ogg and webm).
#!/bin/bash
# For this to work, you need to have ffmpeg
# installed with libvorbis, theora and libvpx ENABLED
# to do that in Homebrew:
# brew reinstall ffmpeg --with-libvpx --with-libvorbis --with-theora
#
# encoding reference:
# https://blog.mediacru.sh/2013/12/23/The-right-way-to-encode-HTML5-video.html
@onderaltintas
onderaltintas / degrees2meters.js
Last active April 12, 2022 01:38 — forked from springmeyer/degress2meters.js
javascript coordinate conversions between 900913(3857) - 4326(lat lon)
var degrees2meters = function(lon,lat) {
var x = lon * 20037508.34 / 180;
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
y = y * 20037508.34 / 180;
return [x, y]
}
//test
lon= -77.035974
lat = 38.898717