Skip to content

Instantly share code, notes, and snippets.

View oroce's full-sized avatar

Róbert Oroszi oroce

  • Budapest, Hungary
View GitHub Profile
@max-mapper
max-mapper / readme.md
Last active November 14, 2017 20:01
streaming unzip example

experimental zip stream parsing

using punzip, which uses mount-url and yauzl

problem: theres a 500mb ZIP with a few CSVs in it, but you only care about one of the files and dont want to download the whole thing and have to unzip the whole zip just to get the one file

  1. brew install osxfuse (or however you install fuse on your OS)
  2. npm install punzip csv-parser -g
  3. punzip http://download.cms.gov/Research-Statistics-Data-and-Systems/Statistics-Trends-and-Reports/Medicare-Provider-Charge-Data/Downloads/PartD_Prescriber_PUF_NPI_DRUG_13.zip --entry=2 | csv-parser --separator=$'\t'
@drkarl
drkarl / gist:739a864b3275e901d317
Last active October 17, 2023 10:43
Ask HN: Best Linux server backup system?

Linux Backup Solutions

I've been looking for the best Linux backup system, and also reading lots of HN comments.

Instead of putting pros and cons of every backup system I'll just list some deal-breakers which would disqualify them.

Also I would like that you, the HN community, would add more deal breakers for these or other backup systems if you know some more and at the same time, if you have data to disprove some of the deal-breakers listed here (benchmarks, info about something being true for older releases but is fixed on newer releases), please share it so that I can edit this list accordingly.

  • It has a lot of management overhead and that's a problem if you don't have time for a full time backup administrator.
@rauchg
rauchg / effective-es6.md
Last active July 11, 2023 09:38
Writing ES6 today, effectively.

Effective transpiling of ES6

After publishing my article on ECMAScript 6, some have reached out to ask how I exactly I make it all work.

I refrained from including these details on the original post because they're subject to immiment obsoletion. These tools are changing and evolving quickly, and some of these instructions are likely to become outdated in the coming months or even weeks.

The main tool

When evaluating the available transpilers, I decided to use 6to5, which has recently been renamed to Babel. I chose it based on:

@webstandardcss
webstandardcss / pedantically_commented_playbook.yml
Last active April 23, 2019 06:03 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options.
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
'use strict';
var React = require('react-native');
var {
Bundler,
StyleSheet,
Text,
TouchableHighlight,
View,
ScrollView,
@jimmycuadra
jimmycuadra / cloud-config.yml
Last active April 19, 2021 03:04
CoreOS cloud-config for DigitalOcean with iptables firewall
#cloud-config
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/<token>
# multi-region deployments, multi-cloud deployments, and droplets without
# private networking need to use $public_ipv4
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@rauschma
rauschma / PreventUnknownGet.js
Last active August 12, 2021 16:07
Prevent getting of unknown properties via ES6 proxies
// The following code is valid ECMAScript 6, but doesn’t work in Firefox, yet
function PreventUnknownGet() {
}
PreventUnknownGet.prototype = new Proxy(Object.prototype, {
get(target, propertyKey, receiver) {
if (!(propertyKey in target)) {
throw new TypeError('Unknown property: '+propertyKey);
}
// Make sure we don’t block access to Object.prototype
@badsyntax
badsyntax / supervisord.conf
Created October 27, 2014 09:56
Set stopasgroup to true to tell supervisor to send the stop signal to the whole process group to prevent orphaned processes when starting/stopping supervisord. This is required when running npm scripts from supervisor.
[program:node-server]
directory=/var/www
command=/usr/bin/npm start
stopasgroup=true
autostart=true
autorestart=true
[program:node-watch]
directory=/var/www
command=/usr/bin/npm run watch
@paf31
paf31 / node-haskell.md
Last active April 14, 2021 18:42
Reimplementing a NodeJS Service in Haskell

Introduction

At DICOM Grid, we recently made the decision to use Haskell for some of our newer projects, mostly small, independent web services. This isn't the first time I've had the opportunity to use Haskell at work - I had previously used Haskell to write tools to automate some processes like generation of documentation for TypeScript code - but this is the first time we will be deploying Haskell code into production.

Over the past few months, I have been working on two Haskell services:

  • A reimplementation of an existing socket.io service, previously written for NodeJS using TypeScript.
  • A new service, which would interact with third-party components using standard data formats from the medical industry.

I will write here mostly about the first project, since it is a self-contained project which provides a good example of the power of Haskell. Moreover, the proces