Skip to content

Instantly share code, notes, and snippets.

View fatuk's full-sized avatar

Andrei Fatiuk fatuk

View GitHub Profile
@fatuk
fatuk / .bash-git.sh
Created March 16, 2014 16:20 — forked from jsmarkus/.bash-git.sh
theme for git in bash
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local YELLOW="\[\033[0;33m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
@fatuk
fatuk / vhost
Last active August 29, 2015 14:14 — forked from gistwebdev/vhost
#!/bin/bash
#
# Display usage info
vhost-usage() {
cat <<"USAGE"
Usage: vhost [OPTIONS] <name>
-h|--help this screen
-pub to create the webhost root in ~/www/name/public/
-url to specify a local address, default is http://name.local
@fatuk
fatuk / template
Last active August 29, 2015 14:14 — forked from gistwebdev/template
<VirtualHost *:80>
ServerAdmin template.email
ServerName template.url
DocumentRoot template.webroot
<Directory />
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
@fatuk
fatuk / config
Last active August 2, 2022 14:57 — forked from slav123/new_gist_file
MC and PEM keys
# Put the following into ~/.ssh/ and just shoose shell connect and set your host 'ec2.xxx.compute.amazonaws.com':
Host ec2.xxx.compute.amazonaws.com
User ec2-user
IdentityFile /path/to/the/my.pem
@fatuk
fatuk / vk-audio-downloader.js
Created July 21, 2017 13:55 — forked from abler98/vk-audio-downloader.js
Скрипт для скачивания музыки VK
/*
Инструкция по использованию:
- заходим в раздел с аудиозаписями
- листаем в самый низ (чтобы прогрузились все аудиозаписи)
- открываем консоль браузера (F12 -> Консоль)
- вставляем код и нажимаем ENTER
- скачивание началось...
- браузер может потребовать разрешение на сохранение файлов, необходимо подтвердить действие
@fatuk
fatuk / gist:804a56ddd56049279da421d0a2a34ec6
Created July 24, 2017 09:51 — forked from thomseddon/gist:3511330
AngularJS byte format filter
app.filter('bytes', function() {
return function(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
});
@fatuk
fatuk / ambient.rb
Created July 19, 2023 13:11 — forked from xavriley/ambient.rb
Ambient piece in Sonic Pi using multiple pentatonic scales
live_loop :foo do
with_fx :echo, mix: 0.3 do
sample :elec_tick if spread(2,7).tick
pattern1 = (knit :a3, 1, :d3, 1, :g3, 1)
pattern2 = (knit :a3, 1, :d3, 1, :g3, 1, :a0, 1)
pattern3 = (knit :a3, 1, :d3, 1, :g3, 1, :a5, 1)
structure = (knit pattern1, 128, pattern2, 32, pattern3, 32).tick(:structure)
@fatuk
fatuk / ambient1
Created August 30, 2023 11:07 — forked from darinwilson/ambient1
Ambient experiment using Sonic Pi
# Ambient experiment for Sonic Pi (http://sonic-pi.net/)
#
# The piece consists of three long loops, each of which plays one of
# two randomly selected pitches. Each note has different attack,
# release and sleep values, so that they move in and out of phase
# with each other. This can play for quite awhile without
# repeating itself :)
live_loop :note1 do
use_synth :hollow
@fatuk
fatuk / dnb.rb
Created August 30, 2023 11:29 — forked from findscode/dnb.rb
My Drum&Bass template
samps = "C:/Program Files (x86)/Sonic Pi/etc/my-samples"
use_bpm 170
live_loop :metro do
sleep 1
cue :beat
sleep 7
cue :ambient
end
@fatuk
fatuk / floating-moment.rb
Created August 30, 2023 11:30 — forked from sven-wachsmuth/floating-moment.rb
Sonic Pi - Soundscape for relaxing
# floating-moment.rb
# ambient soundscape for relaxing and meditation
# Created by Sven Wachsmuth
# https://gist.github.com/sven-wachsmuth/0cc06cc0d698d8932ceb142dcf5231ba
use_bpm 60
laenge_in_takten = 229 # length of the track in beats - 300 means relax 5 minutes :-)
# possible notes out of a sounds-well-scale