Skip to content

Instantly share code, notes, and snippets.

@josephspurrier
josephspurrier / structs_interface.go
Last active March 21, 2024 08:11
Golang - Understand Structs and Interfaces
// Also available at: https://play.golang.org/p/yTTpB5gB6C
package main
import (
"fmt"
)
// *****************************************************************************
// Example 1 - Struct vs Struct with Embedded Type
@nrollr
nrollr / Redis.sh
Created March 29, 2016 11:30
Install Redis via Homebrew
#!/bin/bash
brew install redis # Install Redis using Homebrew
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents # Enable Redis autostart
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist # Start Redis server via launchctl
# homebrew.mxcl.redis.plist contains reference to redis.conf file location: /usr/local/etc/redis.conf
redis-server /usr/local/etc/redis.conf # Start Redis server using configuration file, Ctrl+C to stop
redis-cli ping # Check if the Redis server is running
@jvanbruegge
jvanbruegge / todo.js
Last active April 11, 2017 08:05
A simple todo test in Cyclejs and xstream
import {
div, span, p, input, ul, li, button, body
}
from '@cycle/dom'
import xs from 'xstream'
export function Todo(sources) {
const action$ = intent(sources.DOM);
const model$ = action$
.fold((state, reducer) => reducer(state), {