(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # Stick this in your home directory and point your Global Git config at it by running: | |
| # | |
| # $ git config --global core.attributesfile ~/.gitattributes | |
| # | |
| # See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details | |
| *.c diff=cpp | |
| *.h diff=cpp | |
| *.c++ diff=cpp | |
| *.h++ diff=cpp |
| /* | |
| Below is a simplified state management library for Cycle JS. | |
| It is named after a spoke on a bicycle wheel, because a spoke at the bottom of the wheel will be at the top after a semi-revoltion. | |
| cycle-spoke aims to be approachable, fun, fractal, and easy to use for developers who are familiar with reducers. | |
| Any cycle component can be spoked, spoke creates a local circular reference, and you can have as many spoked components as you like. | |
| It applies any reducers emitted from the components spoke sink to the internal state, and provides a source of the derived state. | |
| A spoked component has no initial state, so you must emit a reducer that sets the initial state on load. | |
| A spoked component may receive reducers from its parent. A spoked component returns it's state as a sink. | |
| /** | |
| * K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex") | |
| * | |
| * More language ports, as well as legacy 2014 OpenSimplex, can be found here: | |
| * https://github.com/KdotJPG/OpenSimplex2 | |
| */ | |
| public class OpenSimplex2S { | |
| private static final long PRIME_X = 0x5205402B9270C86FL; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/usr/bin/env bash | |
| # Assumes apt is available and has a source with the Ansible package | |
| sudo apt-get update | |
| sudo apt-get install ansible -y | |
| # hosts file with only the text '127.0.0.1', change path accordingly | |
| # required because Windows makes files executable by default which Ansible doesn't like | |
| sudo cp /vagrant/provisioning/hosts /tmp | |
| chmod 666 /tmp/hosts |
| alias gundo='git reset HEAD~ && git clean -df' |
| #!/bin/bash | |
| # Put this file at: .git/hooks/post-checkout | |
| # and make it executable | |
| # You can install it system wide too, see http://stackoverflow.com/a/2293578/685587 | |
| PREV_COMMIT=$1 | |
| POST_COMMIT=$2 | |
| NOCOLOR='\e[0m' |
| <?php | |
| error_reporting(E_ALL); | |
| class StringTypeHandler { | |
| public function length() { | |
| return strlen($this); | |
| } | |
| } |
| <?php namespace App; | |
| use Illuminate\Database\Eloquent\Builder as BaseBuilder; | |
| class Builder extends BaseBuilder{ | |
| /** | |
| * Override getModels so it send attributes to the newInstance methods (in newExisting) | |
| */ | |
| public function getModels($columns = array('*')) |
| •_•) | |
| ( •_•)>⌐■-■ | |
| (⌐■_■) |