Skip to content

Instantly share code, notes, and snippets.

View roolebo's full-sized avatar

Roman Bolshakov roolebo

  • Sri Lanka
  • 21:16 (UTC +05:30)
  • X @roolebo
View GitHub Profile
@kristopherjohnson
kristopherjohnson / partial.swift
Last active March 3, 2022 16:11
Experiments with partial function application in Swift
func partial<A, B, T>(f: (A, B) -> T, a: A) -> (B) -> T {
return { f(a, $0) }
}
func bind2nd<A, B, T>(f: (A, B) -> T, b: B) -> (A) -> T {
return { f($0, b) }
}
func partial<A, B, C, T>(f: (A, B, C) -> T, a: A) -> (B, C) -> T {
@dave-tucker
dave-tucker / flows.sh
Last active December 30, 2023 14:28
Open vSwitch Router Flows
sh ovs-vsctl set Bridge s1 "protocols=OpenFlow13"
sh ovs-ofctl add-group -OOpenFlow13 s1 group_id=1,type=all,bucket=output:1
sh ovs-ofctl add-group -OOpenFlow13 s1 group_id=2,type=all,bucket=output:2,4
sh ovs-ofctl add-group -OOpenFlow13 s1 group_id=3,type=all,bucket=output:3
sh ovs-ofctl add-flow -OOpenFlow13 s1 "table=0, priority=1000, dl_type=0x0806, actions=goto_table=105"
sh ovs-ofctl add-flow -OOpenFlow13 s1 "table=0, priority=100, dl_dst=00:00:5E:00:02:01, action=goto_table=5"
sh ovs-ofctl add-flow -OOpenFlow13 s1 "table=0, priority=100, dl_dst=00:00:5E:00:02:02, action=goto_table=5"
sh ovs-ofctl add-flow -OOpenFlow13 s1 "table=0, priority=100, dl_dst=00:00:5E:00:02:03, action=goto_table=5"
sh ovs-ofctl add-flow -OOpenFlow13 s1 "table=0, priority=0, action=goto_table=20"
sh ovs-ofctl add-flow -OOpenFlow13 s1 "table=5, priority=65535, dl_type=0x0800, nw_dst=10.10.10.0/24 actions=goto_table=10"
@mul14
mul14 / 00_etc-hosts.md
Last active May 15, 2024 10:01
/etc/hosts for Vimeo, Reddit, Imgur, GitHub, DigitalOcean, dll

Unblock Steam, Vimeo, Reddit, Imgur, GitHub, DigitalOcean, NPM, PayPal, dll

Saya support Internet Positif untuk memblokir porn, situs judi, dan hal-hal ilegal lainnya. Tapi pemerintah dan ISP sangat konyol karena tidak mengizinkan akses ke Vimeo, Reddit, Imgur, Netflix--yang mana bukanlah situs dengan konten utama ilegal.

Linux / BSD / macOS

Tambahkan list di bawah ke /etc/hosts.

Windows

@joshrotenberg
joshrotenberg / embedded.go
Last active August 4, 2023 08:56
embedded nsqd
package main
// This is a basic example of running an nsqd instance embedded. It creates
// and runs an nsqd with all of the default options, and then produces
// and consumes a single message. You are probably better off running a
// standalone instance, but embedding it can simplify deployment and is
// useful in testing.
// See https://github.com/nsqio/nsq/blob/master/nsqd/options.go and
// https://github.com/nsqio/nsq/blob/master/apps/nsqd/nsqd.go for
@flashvoid
flashvoid / gist:7bcc7c7813114e1bd238
Last active October 14, 2015 17:27
linux network namespace routing
ip netns add space-a
ip netns add space-b
ip link add veth0 type veth peer name veth1
ip link set veth1 netns space-a
ip link add veth2 type veth peer name veth3
ip link set veth3 netns space-b
ifconfig veth0 0.0.0.0 up
ifconfig veth2 0.0.0.0 up
ip netns exec space-a ifconfig veth1 192.168.1.130/32 up
ip netns exec space-a route add -host 192.168.7.141 dev veth1
@hlissner
hlissner / codesign_gdb.md
Last active March 11, 2024 07:09
Codesign gdb on OSX
@pdanford
pdanford / README.md
Last active April 13, 2024 18:19
Launching iTerm2 from macOS Finder

Launching iTerm2 from macOS Finder

(Based on info from Peter Downs' gitub but with modified behavior to open a new terminal window for each invocation instead of reusing an already open window.)

The following three ways to launch an iTerm2 window from Finder have been tested on iTerm2 version 3+ running on macOS Mojave+.

pdanford - April 2020


@nlm
nlm / connect-qemu-serial.sh
Created September 13, 2016 15:37
Connect to QEMU unix socket serial port
#!/bin/sh
SOCKDIR="/var/lib/qemu/sockets"
HOSTNAME="$1"
if [ -z "$HOSTNAME" ]
then
echo "usage: $0 HOSTNAME" >&2
exit 1
fi
@marc-rutkowski
marc-rutkowski / README.md
Last active June 17, 2021 13:17
react-storybook with react-boilerplate (content of the .storybook/ directory)

react-storybook with react-boilerplate

Explains how to install and configure react-storybook into a project created from the react-boilerplate setup.

Intro

React-boilerplate (rbp) is a good starting point to create React apps, with a focus on performance, best practices and DX.

The community around the repository is amazing and a constant source of learning.