Skip to content

Instantly share code, notes, and snippets.

View VladasZ's full-sized avatar

Vladas Zakrevskis VladasZ

  • Lithuania, Klaipėda
View GitHub Profile
@Uriopass
Uriopass / sort_derive.py
Created November 5, 2020 11:01
Sort derives in Rust code to be consistent
import os
import fileinput
import re
a = re.compile(r"^#\[derive\((\s*[a-zA-Z0-9_]+\s*,)*(\s*[a-zA-Z0-9_]+\s*)\)]$")
special = ["Copy", "Clone", "Default", "Debug", "PartialEq", "Eq", "PartialOrd", "Ord", "Serialize", "Deserialize"]
special = {x: i for i, x in enumerate(special)}
@sol-prog
sol-prog / commands.sh
Last active March 20, 2024 14:32
Install GCC 9 on Raspberry Pi and build C++17 programs
# Commands used in the video https://youtu.be/-bCG87jBDqA :
sudo apt update && sudo apt upgrade -y
git clone https://bitbucket.org/sol_prog/raspberry-pi-gcc-binary.git
cd raspberry-pi-gcc-binary
tar -xjvf gcc-9.1.0-armhf-raspbian.tar.bz2
sudo mv gcc-9.1.0 /opt
cd ..
rm -rf raspberry-pi-gcc-binary
@lattner
lattner / async_swift_proposal.md
Last active April 21, 2024 09:43 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

@daviwil
daviwil / 003_1_initial_code.fs
Created August 26, 2016 14:03
Source code from Episode 003 of the_dev_aspect
//
// --------- Model ---------
//
type Details =
{ Name: string
Description: string }
type Item =
{ Details: Details }