Skip to content

Instantly share code, notes, and snippets.

View ylluminate's full-sized avatar

ylluminate ylluminate

View GitHub Profile
@ylluminate
ylluminate / rasterize.js
Created February 22, 2012 18:42
PhantomJS - Rendering a page to image
// As explained here: http://code.google.com/p/phantomjs/wiki/QuickStart
var page = new WebPage(),
address, output, size;
if (phantom.args.length < 2 || phantom.args.length > 3) {
console.log('Usage: rasterize.js URL filename');
phantom.exit();
} else {
address = phantom.args[0];
@ylluminate
ylluminate / rmate.rb
Created February 29, 2012 23:09
rmate script to use on remote hosts
#!/usr/bin/env ruby
# encoding: UTF-8
$VERBOSE = true # -w
$KCODE = "U" if RUBY_VERSION < "1.9" # -KU
require 'optparse'
require 'socket'
require 'fileutils'
@ylluminate
ylluminate / base.html.erb
Created March 5, 2012 19:54
new typus base.html.erb
<!DOCTYPE html>
<html lang="<%= I18n.locale %>">
<head>
<%= render 'admin/shared/head' %>
</head>
<body>
@ylluminate
ylluminate / gist:3890458
Created October 15, 2012 01:59 — forked from jugyo/gist:865475
TextMate command to convert slim to html
#!/usr/bin/env ruby
# Input: Selected Text or Nothing
# Output: Replace Selected Text
require 'tempfile'
def unindent(text)
lines = text.split(/\n/)
level = lines.map{|l| l[/^\s*/].size}.min
@ylluminate
ylluminate / ocp.php
Created April 14, 2013 00:57 — forked from ck-on/ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.6
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
0.1.5 2013-04-12 added graphs to visualize cache state, please report any browser/style bugs
@ylluminate
ylluminate / Rails CMS Options
Last active December 20, 2015 12:09
Up-to-date list of Rails CMS options (Ruby on Rails CMS, both engine and stand alone)
Rails CMS Options
======================
Note: project activity was checked on 11/26/09 for most of these projects, and the "last update" field has not been kept up to date since then.
Active projects:
---------------
LocomotiveCMS
repo: https://github.com/locomotivecms/engine
site: http://www.locomotivecms.com
Last update: Jul 21, 2013
@ylluminate
ylluminate / -
Created September 24, 2013 05:59
test
#!/usr/local/bin/ruby -w
# some input examples
str = 'foo "bar baz" qux'
str = 'foo "bar baz " "bar baz" " bar baz" "bar "klr mre" " " \' "abc" \' baz " qux'
str = '" \' \' " \n " " \' \' "" foo \'ttt sss\' "bar "qqq zzz" baz" "added term" qux " \' \' " yyy xxx'
str = '"""frickin \'#{bar}\'"""'
str = '"" "frickin chicken " #{bar}""""'
str = '"""frickin "#{bar}""""'
str = '"a "b c" "d "e" f g" """h""""' # cf. http://snippets.dzone.com/posts/show/4852
#!/usr/bin/env ruby
require 'net/smtp'
module MailMachine
class NetSmtp < Net::SMTP
class << self
EXCEPTIONS = [Net::SMTPAuthenticationError,
Net::SMTPServerBusy,
Net::SMTPSyntaxError,
Net::SMTPFatalError,
@ylluminate
ylluminate / gist:0fd20847809efc2e950f2e865136997a
Created May 27, 2016 23:23 — forked from ryansobol/gist:5252653
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.