Skip to content

Instantly share code, notes, and snippets.

View literadix's full-sized avatar
💭
I may be slow to respond.

literadix

💭
I may be slow to respond.
View GitHub Profile
@literadix
literadix / RxZipper.js
Created November 25, 2015 12:59 — forked from alanmquach/RxZipper.js
RxJS equivalent of async.parallel
var Rx = require('rx');
var zipper = function () {
// Turning arguments from an object into an actual array so we can use things like map()
return Array.prototype.slice.call(arguments);
};
var array; // Given some array of Observables that you want zipped together
// Or the more classical case where given an array of data to operate on, simply map them into observables
@literadix
literadix / http-benchmark.md
Created December 6, 2016 09:39 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)

Tools

Located in alphabetical order (not prefer)

  • ab – slow and single threaded, written in C
  • apib – most of the features of ApacheBench (ab), also designed as a more modern replacement, written in C
  • baloo – Expressive end-to-end HTTP API testing made easy, written in Go (golang)
  • bombardier – Fast crossplatform HTTP benchmarking tool, written in Go (golang)
  • curl-loader – performance loading of various application services and traffic generation, written in C
  • gatling – High performance load testing framework based on Scala, Akka and Netty, write in Scala
@literadix
literadix / playground.rs
Created May 22, 2018 08:54 — forked from rust-play/playground.rs
Code shared from the Rust Playground
extern crate num;
use num::bigint::BigInt;
fn main() {
match "123123123123123123123".parse::<BigInt>() {
Ok(n) => println!("{}", n),
Err(_) => println!("Error")
}
@literadix
literadix / install-redis.md
Created September 6, 2018 10:59 — forked from hackedunit/install-redis.md
Install and configure Redis on Ubuntu 16.04 with systemd
  1. Install pre-requisities

sudo apt-get install build-essential tcl

  1. Install Redis
cd /tmp
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
@literadix
literadix / README-python-service-on-systemd-activated-socket.md
Created January 24, 2019 15:13 — forked from kylemanna/README-python-service-on-systemd-activated-socket.md
An example network service with systemd-activated socket in Python. #systemd #python #socket #socket-activation

README

The example below creates a TCP server listening on a stream (i.e. SOCK_STREAM) socket. A similar approach can be followed to create a UDP server on a datagram (i.e. SOCK_DGRAM) socket. See man systemd.socket for details.

An example server

Create an simple echo server at ~/tmp/foo/serve.py.

@literadix
literadix / ical.md
Created February 20, 2019 15:58 — forked from meskarune/ical.md
parsing ical file with python icalendar

Archwomen.ics file

BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VEVENT
CREATED:20170220T182458Z
LAST-MODIFIED:20170220T182458Z
DTSTAMP:20170220T182458Z
@literadix
literadix / json.go
Created May 22, 2019 13:43 — forked from uudashr/json.go
Custom JSON time.Time format
const jsonTimeLayout = "2006-01-02T15:04:05+07:00"
// JSONTime is the time.Time with JSON marshal and unmarshal capability
type JSONTime struct {
time.Time
}
// UnmarshalJSON will unmarshal using 2006-01-02T15:04:05+07:00 layout
func (t *JSONTime) UnmarshalJSON(b []byte) error {
parsed, err := time.Parse(jsonTimeLayout, string(b))