Skip to content

Instantly share code, notes, and snippets.

View JoaoPinheiro's full-sized avatar

João Pinheiro JoaoPinheiro

View GitHub Profile
@marcoarment
marcoarment / parallelize.c
Last active October 31, 2022 19:34
A simple shell command parallelizer.
/* parallelize: reads commands from stdin and executes them in parallel.
The sole argument is the number of simultaneous processes (optional) to
run. If omitted, the number of logical CPUs available will be used.
Build: gcc -pthread parallelize.c -o parallelize
Demo: (for i in {1..10}; do echo "echo $i ; sleep 5" ; done ) | ./parallelize
By Marco Arment, released into the public domain with no guarantees.
@lattner
lattner / TaskConcurrencyManifesto.md
Last active June 1, 2024 06:16
Swift Concurrency Manifesto
@mrackwitz
mrackwitz / Dates.swift
Created November 4, 2017 19:15
Dates around DST end
import Foundation
let calendar = Calendar(identifier: .gregorian)
// Daylight Saving Time ends in 2017 on Nov 5th, 2:00 AM in the United States.
// Let's instantiate some `Date`s around that.
let nov4_1am = calendar.date(from: DateComponents(year: 2017, month: 11, day: 4, hour: 1))!
let nov4_2am = calendar.date(from: DateComponents(year: 2017, month: 11, day: 4, hour: 2))!