Skip to content

Instantly share code, notes, and snippets.

@cheeaun
cheeaun / rdrc2014.md
Last active August 29, 2015 14:03
RedDotRubyConf 2014 links & resources

How To Run OpenVPN in a Docker Container

Introduction

This tutorial will explain how to setup and run an OpenVPN container with the help of Docker.

OpenVPN provides a way to create virtual private networks (VPNs) using TLS (evolution of SSL) encryption. OpenVPN protects the network traffic from eavesdropping and man-in-the-middle (MITM) attacks. The private network can be used to securely connect a device, such as a laptop or mobile phone running on an insecure WiFi network, to a remote server that then relays the traffic to the Internet. Private networks can also be used to securely connect devices to each other over the Internet.

Docker provides a way to encapsulate the OpenVPN server process and configuration data so that it is more easily managed. The Docker OpenVPN image is prebuilt and includes all of the necessary dependencies to run the server in a sane and stable environment. Scripts are included to significantly autom

module Enumerable
def first_to_finish
threads = collect { |args| Thread.new { yield(args) } }
loop until done = threads.detect { |t| !t.alive? }
threads.each(&:kill)
done.value
end
end
puts [5, 3, 1, 2, 4].first_to_finish { |x| sleep x }
@cheeaun
cheeaun / rdrc2016.md
Last active June 13, 2018 08:39
RedDotRubyConf 2016 links & resources 😘
@choonkeat
choonkeat / loremipsumizer.js
Last active September 30, 2018 22:30
Bookmarklet to turn any webpage back into a wireframe with "lorem ipsum" text. elements ".brand,.nav,.page-title,.btn,.pagination,.breadcrumb,form label,h1,th" are left intact by default (if you have jQuery on the page) because sometimes we want the basic navigations and buttons), but applying the script again will proceed to anonymize them rega…
/*
Turn any webpage back into a wireframe with "lorem ipsum" text.
1. Bookmark this page
2. Edit the bookmark, and change the link into
javascript:(function(u){ c=document;b=c.body;s=c.createElement('script');s.src=u+'?r='+(new Date()).getTime();b.appendChild(s);})('https://raw.github.com/gist/585708/ac1961130915ed2aef0e67bc97d35ead08513aba/loremipsumizer.js');void(0);
3. Visit any webpage
4. Click on the bookmark
@regeda
regeda / underscore.go
Last active December 12, 2018 10:23
Convert CamelCase to underscore in golang with UTF-8 support.
package main
import (
"testing"
"unicode"
"unicode/utf8"
"github.com/stretchr/testify/assert"
)
@mauvm
mauvm / Jasmine-and-Babel6.md
Created November 12, 2015 10:51
Jasmine ES6 run script for use with Babel 6
$ npm install --save babel-cli babel-preset-es2015
$ npm install --save-dev jasmine

.babelrc:

{
 "presets": ["es2015"]
@Yarith
Yarith / Article - Animate removed DOM elements.md
Last active April 28, 2022 23:50
Elm: Animate the removal of DOM elements with CustomElement and MutationObserver

Elm: Animate the removal of DOM elements with CustomElement and MutationObserver

Desired result

You can see the end result in this ellie. It displays a smooth removal of the clicked items. You can also remove some items from the beginning or the end.

Version 1

https://ellie-app.com/cvCV93KgD56a1

Version 2

An updated ellie with improved performance. This gist was not yet updated with all changes made in this version. Only the article text is somewhat updated.

@dabit3
dabit3 / SingleTableAppSync.md
Last active February 24, 2023 20:05
GraphQL Single Table Design with DynamoDB and AWS AppSync

GraphQL

GraphQL Schema

type Customer {
  id: ID!
  email: String!
}
@dwayne
dwayne / custom-properties.md
Last active August 7, 2023 08:34
Elm Odds and Ends

Custom Properties in Elm

Html.Attributes.style does not support setting custom properties. For e.g. the following won't work:

style "--alert-text-color" "#123456"

re: [Asking for support][support]