Skip to content

Instantly share code, notes, and snippets.

View adwidianjaya's full-sized avatar

Adhe Widianjaya adwidianjaya

  • Surabaya
  • Indonesia
View GitHub Profile
@adwidianjaya
adwidianjaya / low-code-backend.md
Last active April 19, 2020 10:40
Low Code Backend
@abhiaiyer91
abhiaiyer91 / reduxSelectorPattern.md
Last active April 29, 2022 06:00
Redux Selector Pattern

Redux Selector Pattern

Imagine we have a reducer to control a list of items:

function listOfItems(state: Array<Object> = [], action: Object = {}): Array<Object> {
  switch(action.type) {
    case 'SHOW_ALL_ITEMS':
      return action.data.items
    default:
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@indiejoseph
indiejoseph / ffmpeg-mjpeg.sh
Created August 23, 2015 15:53
ffmpeg record mjpg-streamer
ffmpeg -f mjpeg -r 5 -i "http://openwrt:openwrt@localhost:8080/?action=stream" -r 5 ./video.avi
@russss
russss / grab_mjpeg_frame.py
Created August 13, 2011 12:26
Grab a single frame from an MJPEG stream
#!/usr/bin/env python
import socket
import sys
if len(sys.argv) != 3:
print "Usage: %s host:port destfile.jpg" % sys.argv[0]
sys.exit(1)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host, port = sys.argv[1].split(':')