Skip to content

Instantly share code, notes, and snippets.

View mindbound's full-sized avatar
💭
I may be slow to respond.

Arets Paeglis mindbound

💭
I may be slow to respond.
View GitHub Profile
@IanVaughan
IanVaughan / KillValgrind.sh
Created April 15, 2011 08:25
Bash command line to kill one-by-one any valgrind processes running
kill `ps aux | grep [v]algrind | awk '{print $2}' | tail -n1`
@phi-gamma
phi-gamma / word_count.lua
Created May 6, 2012 13:03
Word count with LuaTEX
packagedata = packagedata or { } -- namespace proposal for packages
local word_count = { threshold = 3, }
packagedata.word_count = packagedata.word_count or word_count
dofile(kpse.find_file"char-def.lua") -- unicode tables
dofile(kpse.find_file"lualibs-table.lua") -- old Context table code
local utf = unicode.utf8
local node = node
local type = type
@ckirkendall
ckirkendall / clojure-match.clj
Created June 15, 2012 02:26 — forked from bkyrlach/Expression.fs
Language Compare F#, Ocaml, Scala, Clojure, Ruby and Haskell - Simple AST example
(use '[clojure.core.match :only [match]])
(defn evaluate [env [sym x y]]
(match [sym]
['Number] x
['Add] (+ (evaluate env x) (evaluate env y))
['Multiply] (* (evaluate env x) (evaluate env y))
['Variable] (env x)))
(def environment {"a" 3, "b" 4, "c" 5})
anonymous
anonymous / RustSyntaxProposal
Created March 18, 2013 16:33
Proposal for new syntax for type definition. Motivation: Rust tries to mix concepts from Functional languages with syntax from C/C++. structs (records) are equivalent to the C/C++ version. However enums in rust do not behave like enums from c: Enums in rust are used to define Algebraic Data Types (sum types) that act similar to 'tagged unions' i…
type Name = {
first: ~str,
last: ~str
}
type Shape = Circle(int) | Rect(int, int) // Variants with constructors
type Direction = North | South | East | West // without constructors
@jshaw
jshaw / byobuCommands
Last active July 4, 2024 10:58
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
@NicolasT
NicolasT / nel.ml
Last active May 28, 2019 18:48
Playing with OCaml GADTs
type z
type 'a s
(* Sadly enough, without kind restrictions, this still allows nonsense types like *)
type nonsense = int s
(* GHC 7.6 supports this (lifting types to kinds & kind constraints) ;-) *)
type (_, _) llist =
| Nil : (z, 'a) llist
| Cons : ('a * ('l, 'a) llist) -> ('l s, 'a) llist
@Kimundi
Kimundi / dynamic_typing.rs
Last active January 6, 2023 18:56
Dynamic typing in Rust
use std::unstable::intrinsics::{TyDesc, get_tydesc, forget};
use std::util::Void;
use std::cast::transmute;
///////////////////////////////////////////////////////////////////////////////
// TypeId
///////////////////////////////////////////////////////////////////////////////
/// `TypeId` represents a globally unique identifier for a type
pub struct TypeId {
@stevenblenkinsop
stevenblenkinsop / gist:7165828
Created October 26, 2013 06:05
Demonstration of ref patterns for avoiding moving out of &
enum List<T> {
End,
Node { val: T, next: ~List<T> },
}
fn print_list<T:ToStr>(list: List<T>) {
match list {
End => { println("<X>"); },
Node{val, next} => {
println(val.to_str());
@XVilka
XVilka / TrueColour.md
Last active July 9, 2024 23:28
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!