Skip to content

Instantly share code, notes, and snippets.

View vy-let's full-sized avatar

Violet vy-let

  • Instructure
  • Seattle
  • 17:27 (UTC -08:00)
View GitHub Profile
@vy-let
vy-let / ld.sh
Last active August 29, 2015 13:57
Install libdispatch for use on Linux
# In my experience on Debian and a couple of Ubuntu systems,
# this one-liner gets libdispatch code ready-to-compile and use.
sudo aptitude install clang libblocksruntime-dev libkqueue-dev libpthread-workqueue0 libpthread-workqueue-dev libdispatch0 libdispatch-dev
# Compile with clang.
# (Prefer gcc? It's okay, you can use clang. I won't tell on you.)
clang foo.c -o foo -fblocks -lBlocksRuntime -ldispatch
@vy-let
vy-let / gets.swift
Created June 15, 2014 05:05
Gets in Swift
//
// gets.swift
// smilef
//
// Created by Talus Baddley on 2014-6-5.
// Copyright (c) 2014 Eightt. All rights reserved.
//
// This is to demonstrate a simple, safe gets() implementation
// in Swift, that automatically buffers input on demand and
@vy-let
vy-let / parse^_^.rb
Created June 23, 2014 00:28
Smilef Shell Prototype Parser
#!/usr/bin/env ruby
#encoding: utf-8
require 'yaml'
require 'readline'
require 'parslet'
#
# Prototype Parser
# for the Smilef Shell Language
@vy-let
vy-let / RACStream+SlidingWindow.m
Last active August 29, 2015 14:16
Bringing the sliding window metaphor to RACStreams (RACSequences, RACSignals, etc).
//
// RACStream+SlidingWindow.m
// Bringing the sliding window stream metaphor to RACStreams (RACSequences, RACSignals, etc).
// Copyright © 2015 Talus Baddley. MIT License.
//
// This is heavily UNTESTED. Please contact me if you find bugs.
//
#import <ReactiveCocoa/ReactiveCocoa.h>
@vy-let
vy-let / motd-witty
Created April 28, 2015 01:34
motd-witty
#!/usr/bin/ruby
GREETINGS_FILE = '/etc/motd-witty.json'
#
# motd-witty
#
# Version 1.1
# Talus Baddley, 2013.
body {
font-family: "Helvetica Neue", "Helvetica", sans-serif;
margin: 10% 15%;
background-color: rgb(240, 240, 240);
}
h1 {
border-bottom: 1px solid rgba(0, 0, 0, 0.5);
margin-left: -2em;
margin-right: -2em;
@vy-let
vy-let / terminal-pinwheel.rb
Created July 29, 2015 00:40
Print a clockwise-spinning pinwheel on an ANSI-compliant terminal.
#!/usr/bin/env ruby
begin
loop do
%w( ◐ ◓ ◑ ◒ ).each do |pchar|
print "\x1b[1G\x1b[0K#{pchar} "
sleep 0.1
end
end
@vy-let
vy-let / trash.swift
Last active August 26, 2015 06:02
For moving something to the trash from the command line, instead of rm'ing it.
//
// trash.swift
// For moving something to the trash from the command line
// (instead of rm'ing it).
//
// Created by Violet Baddley on 2015-8-25.
// Copyright © 2015 Violet Baddley. All rights reserved.
// Provided under the 2-Clause BSD License.
//
//
// trash.sandpiper
// For moving something to the trash from the command line
// (instead of rm'ing it)
// in the Glorious Sandpiper Language.
//
// Created by Violet Baddley on 2015-8-25.
// Copyright © 2015 Violet Baddley. All rights reserved.
// Provided under the 2-Clause BSD License.
//
import Foundation
//
// Parsley
// a little sprig of a parser
//
// Violet Baddley
//
// Written for Swift 2.2