Skip to content

Instantly share code, notes, and snippets.

Avatar

Chew Choon Keat choonkeat

View GitHub Profile
@Janiczek
Janiczek / elm-make-readable.mjs
Created April 15, 2022 19:46
elm-make-readable
View elm-make-readable.mjs
import fs from 'fs/promises';
const rules = [
{
rule: /var ([^=]+)( = F\d\([^f]+function)[^(]\(/gmi,
replacement: `var $1$2 __$1( `,
},
{
rule: /(\sA\d\([\s]+)([^,]+)(,[\s]+)(function[^(]+)\(/gm,
replacement: `$1$2$3$4___$2(`,
},
@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
View Article - Animate removed DOM elements.md

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 December 16, 2022 22:29
GraphQL Single Table Design with DynamoDB and AWS AppSync
View SingleTableAppSync.md

GraphQL

GraphQL Schema

type Customer {
  id: ID!
  email: String!
}
@cheeaun
cheeaun / rdrc2016.md
Last active June 13, 2018 08:39
RedDotRubyConf 2016 links & resources 😘
View rdrc2016.md
View first_to_finish.rb
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 }
@mauvm
mauvm / Jasmine-and-Babel6.md
Created November 12, 2015 10:51
Jasmine ES6 run script for use with Babel 6
View Jasmine-and-Babel6.md
$ npm install --save babel-cli babel-preset-es2015
$ npm install --save-dev jasmine

.babelrc:

{
 "presets": ["es2015"]
@regeda
regeda / underscore.go
Last active December 12, 2018 10:23
Convert CamelCase to underscore in golang with UTF-8 support.
View underscore.go
package main
import (
"testing"
"unicode"
"unicode/utf8"
"github.com/stretchr/testify/assert"
)
View DigitalOcean + OpenVPN + Docker.md

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

@cheeaun
cheeaun / rdrc2014.md
Last active August 29, 2015 14:03
RedDotRubyConf 2014 links & resources
View rdrc2014.md
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active January 11, 2023 14:23
Steps to install a Comodo PositiveSSL certificate with Nginx.
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert