Skip to content

Instantly share code, notes, and snippets.

Maxim Velesyuk maximvl

View GitHub Profile
@avar
avar / 30-income-calculon.pl
Last active Jul 22, 2020
Calculate your income in The Netherlands with and without a 30% ruling.
View 30-income-calculon.pl
# To check if this is up-to-date with the tax rates go to
# http://www.expatax.nl/tax-rates-2016.php and see if there's anything
# newer there.
#
# I make no guarantees that any of this is correct. I calculated this
# at the time and have been updating it when new tax rates come along
# because people keep finding this useful.
#
# There's also an interactive JS version of this created by
# @stevermeister at
@andelf
andelf / beam_decompile.erl
Created Mar 19, 2013
Erlang BEAM file decompile to .erl file
View beam_decompile.erl
#!/usr/bin/env escript
% -*- mode: erlang -*-
main([BeamFile]) ->
{ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(BeamFile,[abstract_code]),
io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]).
@bryanhunter
bryanhunter / build-erlang-17.0.sh
Last active Oct 26, 2019
Build Erlang 17.0 on a fresh Ubuntu box (tested on 12.04 and 14.04)
View build-erlang-17.0.sh
#!/bin/bash
# Pull this file down, make it executable and run it with sudo
# wget https://gist.githubusercontent.com/bryanhunter/10380945/raw/build-erlang-17.0.sh
# chmod u+x build-erlang-17.0.sh
# sudo ./build-erlang-17.0.sh
if [ $(id -u) != "0" ]; then
echo "You must be the superuser to run this script" >&2
exit 1
fi
View fry.red
Red [
Title: "fry.red"
Author: ["Gregg Irwin" "Steeve"]
File: %fry.red
Purpose: {
Factor style fry combinators in Red
http://docs.factorcode.org/content/article-fry.html
works somewhat like a reverse collect/keep
}
]
View gameoflife2.red
Red [
Title: "Conway's Game of Life"
Needs: 'View
]
system/view/auto-sync?: no
grid: collect [repeat i 50 [keep/only collect [repeat j 50 [keep random true]]]]
scratchgrid: collect [repeat i 50 [keep/only collect [repeat j 50 [keep false]]]]
a: copy grid/1
b: copy grid/50
@DideC
DideC / heart-animation.red
Last active Jan 30, 2017
Heart animation for Red (only). New parameters added to the (reordered) control panel to play with the animation + credits. Nice time eater ;-)
View heart-animation.red
Red [
title: "Heart animation"
author: "Didier Cadieu"
notes: {
Traduction in Red of Terebus Volodymyr javascript demo : http://codepen.io/tvolodimir/pen/wqKuJ
}
Needs: View
]
;*** Settings
@greggirwin
greggirwin / datatype-help.red
Created Mar 25, 2017
Small GUI experiment for showing datatype information.
View datatype-help.red
Red []
form-all: func [blk][
forall blk [blk/1: form blk/1]
blk
]
types-of: function [value [typeset!]][
; typesets don't support reflection
third load mold value
@rebolek
rebolek / incredidle.red
Created May 15, 2017
Simple tool to show how faces work
View incredidle.red
Red []
inc-value: func [
face
color-id
dest-face
/local value rate
] [
unless face/extra [face/font/color: 255.255.255]
overflow?: false
@toomasv
toomasv / info.red
Last active Nov 28, 2017
To get info about any function
View info.red
Red []
info: func ['fn /name /intro /args /refinements /locals /return /spec
/arg-num /arg-names /arg-types /ref-names /ref-types /ref-num /type /arity?
/local intr ars refs locs ret arg ref typ irefs
][
intr: copy "" ars: make map! copy [] refs: make map! copy [] locs: copy [] ret: copy [] irefs: copy [] typ: ref-arg: ref-arg-type: none
if path? fn [irefs: copy next to-block fn fn: first fn]
if lit-word? fn [fn: to-word fn]
unless find [op! native! function! action!] type?/word get fn [
cause-error 'user 'message ["Only function types accepted!"]
@toomasv
toomasv / l-system.red
Last active Feb 21, 2019
Experiments with L-System
View l-system.red
Red [
Author: "Toomas Vooglaid"
Date: 25-9-2017
Description: {Experiments with L-System}
Last-update: 26-9-2017
Uses: {%models.red https://gist.github.com/toomasv/313e1d8583fb159428222651b76926cd}
Repo: https://github.com/toomasv/l-system
]
context [
ctx: self
You can’t perform that action at this time.