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
@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]}"
@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 / 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?)
# 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 / .fonts.conf
Last active August 29, 2015 14:09 — forked from silv3rm00n/.fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@volo1st
volo1st / check.sh
Created October 9, 2015 07:21
Short snippet to get total tracks
#!/usr/bin/env bash
find ./* -newermt 2015-10-05 | grep xml | xargs grep '<track>' | wc -l
@volo1st
volo1st / selective_rsync.sh
Created October 10, 2015 13:22
Selective rSync
#!/usr/bin/env bash
rsync -rv --include '*/' --include '*.js' --exclude '*' --prune-empty-dirs Source/ Target/
@volo1st
volo1st / monkey_king_elector.rb
Created October 29, 2015 01:01
MonkeyKingElector
require 'minitest/autorun'
class MonkeyKingElector
def elect(n, m)
(1..n).to_a.tap { |x| x.delete_at(m % x.size - 1) while x.size > 1 }[0]
end
end
@volo1st
volo1st / README.md
Created November 9, 2015 02:26 — forked from denji/README.md
Remove WebStorm; PhpStorm; PyCharm; RubyMine; AppCode; CLion, IntelliJ; 0xDBE10 settings and cli-links from Mac OSX

Quick uninstall JetBrains settings:

curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s
@volo1st
volo1st / remove_css_ext.sh
Last active April 21, 2016 03:55
Remove the deprecated unnecessary css extension name from scss files
find . -type f -name '*.css.scss' -exec bash -c 'mv $1 $(dirname "$1")/$(basename "$1" .css.scss).scss' _ {} \;