Skip to content

Instantly share code, notes, and snippets.

use std::io::stdin;
fn main() {
let mut line = String::new();
loop {
let n_read = stdin().read_line(&mut line).unwrap();
println!("n_read: {}", n_read);
@soggybag
soggybag / ViewController.swift
Created February 23, 2016 19:27
Animate drawing sine wave. CABasicAnimation and UIBezierPath
// Draw a sine curve with a fill
let centerY = frame.height / 2 // find the vertical center
let steps = 200 // Divide the curve into steps
let stepX = frame.width / CGFloat(steps) // find the horizontal step distance
// Make a path
let path = UIBezierPath()
path.moveToPoint(CGPoint(x: 0, y: centerY))
// Loop and draw steps in straingt line segments
@rdebath
rdebath / README
Last active June 23, 2024 17:46
Original brainfuck distribution by Urban Müller
This archive contains the following programs:
bfc The compiler for the 'brainfuck' language (240 bytes!)
bfc.asm Source for the compiler
bfi The interpreter for the 'brainfuck' language
bfi.c Source for the interpreter (portable)
src/ Some example programs in 'brainfuck'
src/atoi.b Reads a number from stdin
src/div10.b Divides the number under the pointer by 10
src/hello.b The ubiquitous "Hello World!"
@staltz
staltz / introrx.md
Last active June 29, 2024 15:58
The introduction to Reactive Programming you've been missing