Skip to content

Instantly share code, notes, and snippets.

View volo1st's full-sized avatar
🏠
Working from home

Vincent volo1st

🏠
Working from home
View GitHub Profile
# Change Java Runtime:
sudo update-alternatives --config java
# Delete Open-JDK
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
# Change fonts - remove hinting:
http://askubuntu.com/questions/32624/ugly-fonts-in-netbeans-how-can-i-make-it-use-the-system-font
# Change RubyMine AntiAliasing first:
@volo1st
volo1st / calculator.rb
Created July 2, 2014 07:25
Implementation of a simple calculator
class Calculator
def calc(raw)
return 0 if raw.empty?
arith_calc(sanitize(raw))
end
protected
def sanitize(raw='')
raw.scan(/[0-9]|\+|\-|\*|\/|\(|\)|sqrt/).join.
split(/(\+)|(\-)|(\*)|(\/)|(\()|(\))|(sqrt)/).reject(&:empty?)
@volo1st
volo1st / index.html
Created December 13, 2013 19:55
workaround index.html file for the formalize development use
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
.my.select {
width: 120px;
font-size: 12px;
background-color: #ddd;
cursor: pointer;
@volo1st
volo1st / test.rb
Last active December 28, 2015 10:59
String interpolation testing for Ruby gem `spreadsheet`
require 'spreadsheet'
Spreadsheet.client_encoding = 'UTF-8'
test_data = {:foo => 'a/a', :bar => 'normal'}
book = Spreadsheet::Workbook.new
sheet = book.create_worksheet :name => "#{test_data[:foo]}"
sheet = book.create_worksheet :name => "#{test_data[:bar]}"