Skip to content

Instantly share code, notes, and snippets.

Taking a break from toxicity & abuse

Anton Gilgur agilgur5

Taking a break from toxicity & abuse
View GitHub Profile
benjick / persist.js
Created Jun 15, 2017
mobx-state-tree persist PoC
View persist.js
/* globals localStorage */
import { onSnapshot, applySnapshot } from 'mobx-state-tree';
import Storage from './storage';
export const persist = (name, store, options, schema = {}) => {
let hydrated = false;
let storage =;
if (typeof localStorage !== 'undefined' && localStorage === storage) {
View *

tracked npm

@tracked is a decorator for Preact that makes working with state values no different than properties on your component instance.

It's one 300 byte function that creates a getter/setter alias into state/setState() for a given key, with an optional initial value. The "magic" here is simply that it works as a property decorator rather than a function, so it appears to integrate directly into the language.

tracked has no dependencies and works with any component implementation that uses this.state and this.setState().


danielearwicker / example.ts
Last active Feb 19, 2017
Remox (Redux in MobX)
View example.ts
import { autorun } from "mobx";
import { createStore, Action, Reducer } from "./remox"
interface Person { firstName: string; lastName: string; }
interface SetFirstName { type: "SET_FIRST_NAME", newFirstName: string; }
interface SetLastName { type: "SET_LAST_NAME", newLastName: string; }
function personReducer(state:Person, action: SetFirstName | SetLastName) {
ruffsl / Dockerfile
Last active Jan 27, 2022
Small ROS Network Example
View Dockerfile
FROM ros:indigo-ros-base
# install ros tutorials packages
RUN apt-get update && apt-get install -y \
ros-indigo-ros-tutorials \
ros-indigo-common-tutorials \
&& rm -rf /var/lib/apt/lists/
aripalo /
Last active Jun 30, 2017
Using webpack and its polling watch feature (via watchpack) can drain CPU which is due to watchpack polling all the npm deps within node_modules folder. This is a quick hack/fix until proper fix is merged & available in watchpack.
# Should be used until is merged and available in npm
# See for more info
# Ensure we have npm
if ! hash npm 2>/dev/null; then
echo 'No NPM installed!'
exit 1
rajadain / ConEmu-MaterialTheme.xml
Last active Oct 17, 2021
ConEmu Material Theme
View ConEmu-MaterialTheme.xml
<key name="Colors" modified="2015-12-10 22:46:43" build="151210">
<value name="Count" type="dword" data="00000001"/>
<key name="Palette1" modified="2015-12-10 22:46:43" build="151210">
<value name="Name" type="string" data="Material Theme"/>
<value name="ColorTable00" type="dword" data="004d4335"/>
<value name="ColorTable01" type="dword" data="006b60eb"/>
<value name="ColorTable02" type="dword" data="008de8c3"/>
<value name="ColorTable03" type="dword" data="0095ebf7"/>
<value name="ColorTable04" type="dword" data="00c4cb80"/>
<value name="ColorTable05" type="dword" data="009024ff"/>
megamaddu / fetch-helpers.js
Last active Dec 23, 2019
Fetch API Helpers
View fetch-helpers.js
import fetch from 'isomorphic-fetch'
const setupRequestOptions = (options = {}, overrideMethod) => {
if (overrideMethod) options.method = overrideMethod
if (!options.headers) options.headers = {}
options.credentials = 'same-origin'
return options
const setupJsonRequestOptions = (options, overrideMethod) => {
gaearon / slim-redux.js
Last active Jan 13, 2022
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
View slim-redux.js
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
xinan / material-theme.itermcolors
Created Aug 1, 2015
Material Theme iTerm2 Port
View material-theme.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<key>Ansi 0 Color</key>
<key>Blue Component</key>
<key>Green Component</key>
voxxit /
Last active Apr 19, 2021
Consul + Vault + MySQL = <3
git clone vault
cd vault
docker-compose up -d
export VAULT_ADDR=

Initializing a vault:

vault init