Skip to content

Instantly share code, notes, and snippets.

View barbagrigia's full-sized avatar

Vlad Trukhin barbagrigia

View GitHub Profile
@barbagrigia
barbagrigia / macOS_virtualbox.sh
Created September 21, 2017 23:41 — forked from kevin-smets/macOS_virtualbox.sh
Convert macOS installer for use in VirtualBox
#!/bin/bash
# Disclaimer: never got this to work properly and have not attempted it since.
# This will require about 30GB of space, still in experimental phase right now
sudo gem install iesd
cd /Applications # Or wherever you hve the "Install 10.12 Developer Preview.app" available
iesd -i Install\ 10.12\ Developer\ Preview.app -o macos.dmg -t BaseSystem
hdiutil convert macos.dmg -format UDSP -o macos.sparseimage
@barbagrigia
barbagrigia / harp_and_browser-sync_combo.md
Created September 21, 2017 23:40 — forked from kevin-smets/harp_and_browser-sync_combo.md
harp + browsers-sync, start developing for the web in under a minute (probably ;) )

What is this combo?

Static file server with livereload, preprocessors, synchronised testing over multiple browser instances and batteries included. This setup uses Harp and Browsersync, hence the name.

Prerequisite

You will need node, install it if you haven't already.

Init all the things

@barbagrigia
barbagrigia / concourse.md
Created September 21, 2017 23:36 — forked from kevin-smets/concourse.md
Setup the Concourse binary locally on macOS and run the hello world example.

Prerequisites

Installs

Concourse

curl -Lo concourse https://github.com/concourse/concourse/releases/download/v2.5.0/concourse_darwin_amd64 && chmod +x concourse && mv concourse /usr/local/bin
@barbagrigia
barbagrigia / 1_kubernetes_on_macOS.md
Created September 21, 2017 23:36 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@barbagrigia
barbagrigia / one-line-asset-servers.md
Created September 21, 2017 23:35 — forked from kevin-smets/one-line-asset-servers.md
One liners for CLI asset servers

Https / Http2

Caddy

macOS: brew install caddy

caddy --conf=<( echo -e ':8080\ntls self_signed' )

Make sure to use https://, otherwise you'll download a.. download file. Since it's self signes, you'll need to ignore any security warnings in order to continue.

@barbagrigia
barbagrigia / macos-virtualbox-ubuntu-server-docker.md
Created September 21, 2017 23:32 — forked from kevin-smets/macos-virtualbox-ubuntu-server-docker.md
macOS VirtualBox headless Ubuntu Server and Docker setup

Get started

Install virtualbox and the extension pack:

brew cask install docker virtualbox virtualbox-extension-pack

Download the ubuntu server image and create a VBox for it, the rest of the readme assumes it is named "Ubuntu Server".

Enable SSH

@barbagrigia
barbagrigia / ..homeSync.md
Created September 21, 2017 23:32 — forked from kevin-smets/..homeSync.md
Feeling homeSync? Sync your home dir to a git repo with launchd every 30 minutes (macOS)

Feeling homeSync?

  1. Place homeSync.sh and homeSync.plist in your home dir
  2. It's recommended to place the .gitignore in your home dir as well, to prevent checking in all your things :)

After doing that, run the following commands in ~/.

cd ~
git init
git remote add origin 
@barbagrigia
barbagrigia / iterm2-solarized.md
Created September 21, 2017 23:23 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@barbagrigia
barbagrigia / prefetch.js
Created September 21, 2017 02:11 — forked from acdlite/prefetch.js
Prefetching in React
function prefetch(getKey, getValue, getInitialValue, propName) {
const inFlight = new Set();
const cache = new Map();
return ChildComponent => {
return class extends React.Component {
state = {value: getInitialValue(this.props)};
componentWillReceiveProps(nextProps) {
const key = getKey(nextProps);
if (cache.has(key)) {
// Use cached value
@barbagrigia
barbagrigia / coordinating-async-react.md
Created September 21, 2017 02:10 — forked from acdlite/coordinating-async-react.md
Demo: Coordinating async React with non-React views

Demo: Coordinating async React with non-React views

tl;dr I built a demo illustrating what it might look like to add async rendering to Facebook's commenting interface, while ensuring it appears on the screen simultaneous to the server-rendered story.

A key benefit of async rendering is that large updates don't block the main thread; instead, the work is spread out and performed during idle periods using cooperative scheduling.

But once you make something async, you introduce the possibility that things may appear on the screen at separate times. Especially when you're dealing with multiple UI frameworks, as is often the case at Facebook.

How do we solve this with React?