Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeff Kreeftmeijer jeffkreeftmeijer

View GitHub Profile
View bang.gemspec
Gem::Specification.new do |s|
s.name = 'bang'
s.version = '0.1.0'
s.platform = Gem::Platform::RUBY
s.author = 'Jeff Kreeftmeijer'
s.email = 'jeff@kreeftmeijer.nl'
s.summary = 'Bang!'
s.description = 'Bangs existing model methods'
s.files = ['bang.rb']
View http_server.rb
require 'socket'
require 'rack'
require 'rack/lobster'
app = Rack::Lobster.new
server = TCPServer.new 5678
while session = server.accept
request = session.gets
puts request
View mice.css
.mouse, #preview{
position: absolute;
background-repeat: no-repeat;
height: 22px;
min-width: 15px;
z-index: 100;
}
.mouse{
background-image: url('../images/cursor.png');
@jeffkreeftmeijer
jeffkreeftmeijer / README.md
Last active Jan 30, 2019
enough.css is a tiny CSS style sheet with most of the styling you'll need for that blog of yours. It moved to https://github.com/jeffkreeftmeijer/enough.css
View README.md
View frame.html
<html>
<head>
<style>
body{
margin: 0;
}
div{
padding: 10px 10px 10px 10px;
}
View ansi_colors.adoc

Terminal colors with ANSI escape sequences

Terminal emulators use ANSI escape sequences to --amongst other things like controlling the cursor’s position-- read the desired text and background color when printing output.

$ echo -e "\033[31mred\033[m" # Prints "red" in red.

While most terminal emulators, including Apple’s Terminal.app, support true color now, most utilities use one of the main sixteen colors (black, red, green, yellow, blue, magenta, cyan, white, and a high intensity or bright version of each). For example, git shows diffs with additions in green and deletions in red, and most testing frameworks print green dots and red "F"s for failures.

@jeffkreeftmeijer
jeffkreeftmeijer / README.textile
Created Nov 14, 2010
A stupid RSpec formatter that prints FFFUUU instead of FFFFF. Heh.
View README.textile

FffuuuFormatter

A stupid RSpec formatter that prints FFFUUU instead of FFFFF. Heh.

Installation

Throw it in a file and run your specs like this:

$ rspec -r path/to/fffuuu_formatter.rb -f FffuuuFormatter spec/
You can’t perform that action at this time.