[ Jan Lelis ] janlelis

View palava
1 2 3 4 5 6 7 8 9 10
upstream palava_machine {
server 127.0.0.1:4240;
}
 
server {
listen 443 ssl;
server_name example.com; # TODO
 
ssl on;
ssl_certificate /path/to/your/ssl/cert.crt; # TODO
View palava-machine
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
 
invoke()
{
echo "[$1]"
su - palava -c "ruby -S palava-machine-daemon $1"
}
 
start_multiple()
{
View gemfile
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env ruby
 
# USAGE
# gemfile [--bundle] [--details] [--fetch] [--sorted] [--commentate]
# DESCRIPTION
# Displays gem urls and summaries found in a Gemfile.
# cd into a directory with a Gemfile and run `gemfile`
# PREREQUISITES
# gem install bundler paint
# FLAGS
View ruby_indentation.rb
1 2 3 4 5 6 7 8 9 10
require 'coderay'
require 'set'
 
module RubyIndentation
VERSION = '0.2.0'
 
def self.[](buffer)
opening_and_modifier_tokens = %w[if unless until while].to_set
opening_tokens = %w[begin case class def for module do {].to_set
closing_tokens = %w[end }].to_set
View permalink.js
1 2 3 4 5 6 7 8 9 10
View hole4.rb
1 2 3 4 5 6 7 8
# hole 3 in 93 bytes (only counting newlines between method body)
# see http://rubysource.com/ruby-golf/
 
def play(i)
s=%w[Rock Paper Scissors]
p=s.index i
s[c=rand(3)]+",#{p==c ?:Draw: p&&p==-~c%3?:Win: :Lose}"
end
View logger-colors.rb
1 2 3 4 5 6 7 8 9 10
# Colorizes the output of the standard library logger, depending on the logger level:
# To adjust the colors, look at Logger::Colors::SCHEMA and Logger::Colors::constants
 
require 'logger'
 
class Logger
module Colors
VERSION = '1.0.0'
 
NOTHING = '0;0'
View .railsrc
1 2 3 4 5 6 7 8 9 10
# .railsrc for Rails 3, encoding: utf-8
# see http://rbjl.net/49-railsrc-rails-console-snippets
 
if !Rails.application then warn "Rails isn't loaded, yet... skipping .railsrc" else
# # #
 
def ripl?; defined?(Ripl) && Ripl.instance_variable_get(:@shell); end
 
# # #
# loggers
View blip
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env ruby
 
require 'rubygems' unless defined? Gem
require 'clipboard'
 
if $stdin.tty? && $*.empty?
puts Clipboard.paste # the trailing new-line is intended ;)
else
Clipboard.copy ARGF.read
end
View pws.rb
1
# pws has been refactored! See https://github.com/janlelis/pws
Something went wrong with that request. Please try again.