Skip to content

Instantly share code, notes, and snippets.

View fk1blow's full-sized avatar

Dragos Tudorache fk1blow

  • Bucharest
View GitHub Profile
@fk1blow
fk1blow / create_new_user.md
Created February 6, 2022 18:26 — forked from JeremyIglehart/create_new_user.md
How to create a new user and remove the `pi` user on a Raspberry Pi

How to create a new user and remove the pi user on a Raspberry Pi

Note: This has been tested in Rasbian Buster released on 2019-06-20

Important: replace jeremy below with whatever username you'd like as your new user.

  1. sudo adduser jeremy
    • You will be asked to enter a password
    • When filling out basic information about the user, you may leave it blank
@fk1blow
fk1blow / consul.sh
Created August 2, 2017 08:40 — forked from xbotter/consul.sh
Install Consul on Ubuntu 16.04
#!/bin/bash
apt-get install -y curl unzip
mkdir -p /var/lib/consul
mkdir -p /usr/share/consul
mkdir -p /etc/consul/conf.d
curl -OL https://releases.hashicorp.com/consul/0.7.5/consul_0.7.5_linux_amd64.zip
unzip consul_0.7.5_linux_amd64.zip
mv consul /usr/local/bin/consul

Notice

This script is no longer required with Docker for Mac which includes an option to run Docker at startup and doesn't use docker-machine to administer the local Docker engine.

Requirements

  • Docker Machine + Docker
  • curl
  • A Virtualbox-driven Docker Machine called "default" docker-machine create --driver virtualbox default (this is the default with Docker toolkit).
@fk1blow
fk1blow / playground.rs
Created February 11, 2017 01:11 — forked from anonymous/playground.rs
Shared via Rust Playground
fn max<T: PartialOrd + PartialEq>(a: T, b: T) -> T {
if a < b {
b
}
else {
a
}
}
fn main() {
@fk1blow
fk1blow / Login.jsx
Last active December 26, 2016 02:47
import React, {Component} from 'react';
import RaisedButton from 'material-ui/RaisedButton';
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
import 'rxjs/add/operator/combineLatest';
import 'rxjs/add/operator/skip';
import styles from './index.css';
import TextField from 'components/TextField';
const noop = () => {};
@fk1blow
fk1blow / dobar_effect.ex
Created December 21, 2016 23:04
i have not idea what is going on
defmodule Dobar.Effect do
alias Dobar.Error
alias Dobar.Reaction
@type t :: %__MODULE__{
reaction: Reaction.t,
error: Error.EvaluationError.t | nil,
responders: [...],
robot: binary | atom
}
@fk1blow
fk1blow / rxjs_operators_by_example.md
Created November 2, 2016 00:10 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example
@fk1blow
fk1blow / state-example-game.js
Last active September 10, 2015 11:07 — forked from hallettj/state-example-game.js
Implementation of a State monad in JavaScript
/*
* Example of a state monad in use. This is adapted from an example on
* the Haskell Wiki:
* http://www.haskell.org/haskellwiki/State_Monad#Complete_and_Concrete_Example_1
*/
require(['state', 'qunit'], function(state, qunit) {
/*
* playGame() is a recursive function that given an array of moves
* defines an algorithm for constructing a final game score. Along
@fk1blow
fk1blow / introrx.md
Last active August 29, 2015 14:21 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.