Skip to content

Instantly share code, notes, and snippets.

@lattner
lattner / TaskConcurrencyManifesto.md
Last active September 28, 2025 00:18
Swift Concurrency Manifesto
@riemers
riemers / dropbox.py
Last active May 22, 2020 02:15
Python uploader for dropbox (original found at https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=164166)
import os
import subprocess
from subprocess import Popen, PIPE
#The directory to sync
syncdir="/home/homeassistant/.homeassistant/"
#Path to the Dropbox-uploaded shell script
uploader = "/home/homeassistant/.homeassistant/extraconfig/shell_code/dropbox_uploader.sh"
#If 1 then files will be uploaded. Set to 0 for testing
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active October 7, 2025 16:12
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Yuki44
Yuki44 / MPlayer.java
Created November 29, 2016 14:07 — forked from EdwinSilvaDK/MPlayer.java
Music Player using JavaFX
package com.github.shkesar.JMusic;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@yurivish
yurivish / venn-diagrams.js
Last active December 26, 2020 03:20
Area-proportional Venn Diagrams
// Since `overlapArea` function is monotonic increasing, we can perform a
// simple bisection search to find the distance that leads to an overlap
// area within epsilon of the desired overlap.
function distanceForOverlapArea(r1, r2, desiredOverlap) {
// Ensure r1 <= r2
if (r1 > r2) {
var temp = r2;
r2 = r1;
r1 = temp;
}
@djromero
djromero / channel.swift
Last active January 18, 2018 22:31 — forked from seanlilmateus/channel.swift
golang like channels in swift
import XCPlayground
import Foundation
import UIKit
class Channel<T>
{
var stream: Array<T>
let queue: dispatch_queue_t
let semaphore: dispatch_semaphore_t
@Avaq
Avaq / combinators.js
Last active August 6, 2025 20:57
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@anniecherk
anniecherk / dfs.rkt
Created December 29, 2015 22:03
An implementation of depth first search for recurse center interview
; Annie Cherkaev, Dec 29th 2015
#lang racket
; An implementation of depth first search
; Trees are represented as lists, where the first element is the 'name' of the node, and the rest of the list is the children of that node
; ie: a
; / \
; b c
; is represented as (a (b) (c))
;