Skip to content

Instantly share code, notes, and snippets.

View RickCarlino's full-sized avatar
💾

Rick Carlino RickCarlino

💾
View GitHub Profile
@geowy
geowy / array_to_proc.rb
Last active September 16, 2015 12:19
Array#to_proc, shorthand for creating a block that selects elements of an array/hash/collection.
class Array
# Returns a proc which calls [] with the array's contents as arguments
#
# ====Usage
# [[1, 2], [3, 4], [5, 6]].map(&[0])
# # => [1, 3, 5]
#
# [{ hello: 'world' }, { hello: 'sun', goodbye: 'moon' }].map(&[:hello])
# # => ['world', 'sun']
@Ravenstine
Ravenstine / reactor.cr
Created September 8, 2015 05:29
A very simple event loop written in Crystal. (crystal-lang.org)
module Reactor
class Task
property :block
def initialize(timestamp=Time.now, milliseconds=0, &block : Loop ->)
@block = block
@timestamp = timestamp.epoch_ms
@milliseconds = milliseconds
end
def run reactor

Volt Tasks - Introduction

Getting Started

First, let's get a basic application set up. I will assume you've already dug around a simple project, but if you are completely new to Volt I would recommend reading through the documentation here. We create a project with a simple

volt new project_name

@RickCarlino
RickCarlino / classifier.rb
Created April 5, 2015 03:21
Using the Ruby 'classifier' gem to categorize a quote as "Ben Franklin" or "Paris Hilton"
require 'classifier'
robot_overlord = Classifier::Bayes.new 'hilton', 'franklin'
robot_overlord.train_hilton("The only rule is don't be boring and dress cute wherever you go. Life is too short to blend in.")
robot_overlord.train_hilton("The way I see it, you should live everyday like its your birthday.")
robot_overlord.train_hilton("No matter what a woman looks like, if she's confident, she's sexy.")
robot_overlord.train_hilton("I'd imagine my wedding as a fairy tale... huge, beautiful and white.")
robot_overlord.train_hilton("There's nobody in the world like me. I think every decade has an iconic blonde, like Marilyn Monroe or Princess Diana and, right now, I'm that icon.")
robot_overlord.train_hilton("Some girls are just born with glitter in their veins.")
@RickCarlino
RickCarlino / sublime.json
Created December 7, 2014 02:05
The only sublime settings you would ever want.
{
"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_size": 12,
"ignored_packages":
[
"Vintage"
],
"rulers":
[
@nrc
nrc / tools.md
Last active March 8, 2025 06:01
Rust tooling

Rust developer tools - status and strategy

Availability and quality of developer tools are an important factor in the success of a programming language. C/C++ has remained dominant in the systems space in part because of the huge number of tools tailored to these lanaguages. Succesful modern languages have had excellent tool support (Java in particular, Scala, Javascript, etc.). Finally, LLVM has been successful in part because it is much easier to extend than GCC. So far, Rust has done pretty well with developer tools, we have a compiler which produces good quality code in reasonable time, good support for debug symbols which lets us leverage C++/lanaguge agnostic tools such as debuggers, profilers, etc., there are also syntax highlighting, cross-reference, code completion, and documentation tools.

In this document I want to layout what Rust tools exist and where to find them, highlight opportunities for tool developement in the short and long term, and start a discussion about where to focus our time an

@gilbert
gilbert / Entry.js
Last active December 6, 2018 22:46
Event Volunteers: Mithril.js Example from Tutorial Part 1 http://gilbert.ghost.io/mithril-js-tutorial-1/
//
// A model representing an Entry
//
window.Entry = {}
var store = []
var idCounter = 1
Entry.all = function () {
return store
@wdullaer
wdullaer / install.sh
Last active October 9, 2024 19:47
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@staltz
staltz / introrx.md
Last active March 13, 2025 12:33
The introduction to Reactive Programming you've been missing