Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Marek Fajkus turboMaCk

🏠
Working from home
Block or report user

Report or block turboMaCk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@turboMaCk
turboMaCk / main.rs
Last active Nov 30, 2017
Simple rust program which deals with file reads in 3 different ways
View main.rs
// This program will read test.txt file and print it line by line
// implemented in 3 different ways
use std::io::BufReader;
use std::io::BufRead;
use std::fs::File;
fn main() {
// Procedural
View gist:3bf3999c4ed8cb9a899097dece259597
Verifying that "turbo_mack.id" is my Blockstack ID. https://onename.com/turbo_mack
@turboMaCk
turboMaCk / brew_reinstall_all.sh
Last active Feb 14, 2017
Reinstall all home brew packages
View brew_reinstall_all.sh
#!/bin/bash
# Reinstall all brew packages and dependencies in the correct order
# - list all installed packages
# - print the package followed by its dependencies
# - print the package and a single depenency on each line
# - perform a topographical sort
# - print out each package in the correct order on a single line
# - pass to brew reinstall
brew list \
@turboMaCk
turboMaCk / currying.js
Last active Nov 16, 2016
Currying vs partial application vs factory
View currying.js
/**
Example is using Heron's formula for calculating area of triangle
more info: https://en.wikipedia.org/wiki/Heron%27s_formula
*/
// Given a function of type f: (X x Y x Z) -> N,
// currying produces f: X -> (Y -> (Z -> N))
// Num -> (Num -> (Num -> Num))
@turboMaCk
turboMaCk / func.erl
Last active Oct 13, 2016
Erlang recursion examples
View func.erl
-module(func).
-export([fac/1, ft/1, len/1, lt/1, fib/1, tail_fib/1]).
%% basic recursive implementation of factorial
fac(N) when N == 0 -> 1;
fac(N) when N > 0 ->
N*fac(N-1).
%% Tail recursion implementation of factorial
@turboMaCk
turboMaCk / func.erl
Created Oct 13, 2016
Erlang recursion examples
View func.erl
-module(func).
-export([fac/1, ft/1, len/1, lt/1, fib/1, tail_fib/1]).
%% basic recursive implementation of factorial
fac(N) when N == 0 -> 1;
fac(N) when N > 0 ->
N*fac(N-1).
%% Tal recursion implementation
@turboMaCk
turboMaCk / hints.elm
Last active Sep 13, 2016
Hits for wojcek
View hints.elm
import Html exposing (..)
import List exposing (..)
multiSnd : number -> (List (a, number) -> List (a, number))
multiSnd k =
map (\(a, b) -> (a, b*k))
multiSnd3 = multiSnd 3
multiSnd4 = multiSnd 4
@turboMaCk
turboMaCk / rounded-rect.html
Last active Aug 15, 2016
d3 rounded rect function
View rounded-rect.html
<!doctype html>
<html>
<body>
<svg></svg>
</body>
</html>
View keybase.md

Keybase proof

I hereby claim:

  • I am turbomack on github.
  • I am turbo_mack (https://keybase.io/turbo_mack) on keybase.
  • I have a public key ASCPf6tiCpj7lboOodSovR6CKk5R8DgcD0X4ht9Cim0Swwo

To claim this, I am signing this object:

@turboMaCk
turboMaCk / Repos.elm
Created May 28, 2016
Use ! infix function in update
View Repos.elm
module Repos exposing (main)
import List
import Html exposing (..)
import Html.App
import Html.Attributes exposing (..)
import Html.Events as Events
import Http
import Json.Decode as Json exposing ((:=))
import Task exposing (..)
You can’t perform that action at this time.