Skip to content

Instantly share code, notes, and snippets.

View ylluminate's full-sized avatar

ylluminate ylluminate

View GitHub Profile
@ylluminate
ylluminate / perfectelementary.bash
Created June 17, 2017 00:16
HowTo Install the perfect Elementary-OS
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
#!/usr/bin/env ruby
require 'net/http'
def convert_currency(from_curr, to_curr)
doc = Net::HTTP.get('www.google.com', "/finance/converter?a=1&from=#{from_curr}&to=#{to_curr}")
regexp = Regexp.new("(\\d+\\.{0,1}\\d*)\\s+#{to_curr}")
regexp.match doc
$1.to_f
end
@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.

#!/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 / 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 / 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 / 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 / image.md
Last active August 29, 2015 14:23 — forked from jah2488/image.md

so small

Contrived example demonstrating microgem dependencies

contrived is a microgem that depends on another microgem array_range, however gemspecs don't support DVCS dependencies. So how do we solve this without prematurely denting the universe?

Just use bundler.

Usage

Add all microgems to your project's Gemfile:

This is in reference to https://plus.google.com/105596541985629444566/posts/27y819XoT2V
to show simple steps I took to try and reproduce the described issue based upon the
information available. This is very simple benchmarking with an almost vanilla Rails 4
application using sqlite as the database so is not useful other than to demonstrate the
out of the box performance with TorqueBox and Trinidad under these situations is very
close.