Skip to content

Instantly share code, notes, and snippets.

@voidius
voidius / font-end.md
Created January 21, 2016 21:46
Useful stuff for front-end development
@voidius
voidius / Vagrantfile
Created December 8, 2015 09:53
Virtualbox host-to-guest time synchronisation
# Time sync for Vagrantboxes
vb.customize ["setextradata", :id, "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled", 0]
vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 1000]
vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-start", 1 ]
...
config.vm.provision :shell, inline: 'timedatectl set-timezone Europe/Riga'
@voidius
voidius / git-repo-migration.sh
Created November 17, 2015 09:31
GIT repo migration
$ git clone --mirror <old_repo_url>
$ git remote rename origin origin-old
$ git remote add origin <new_repo_url>
$ git push --all origin
One can use the following v$nls_parameters view to find the database LANGUAGE, TERRITORY and CHARACTER SET.
select DECODE(parameter, 'NLS_CHARACTERSET', 'CHARACTER SET',
'NLS_LANGUAGE', 'LANGUAGE',
'NLS_TERRITORY', 'TERRITORY') name,
value from v$nls_parameters
WHERE parameter IN ( 'NLS_CHARACTERSET', 'NLS_LANGUAGE', 'NLS_TERRITORY')
/
NAME VALUE
@voidius
voidius / birth_date_from_person_code_parser.rb
Created March 3, 2015 16:23
Birth date from personal identity number parser
# person code format: ddmmyy-cxxxx
# where
# dd - is for birth day
# mm - is for birth month
# yy - is for birth year
# c - is for birth century (0 - 18xx, 1 - 19xx, 2 - 20xx)
# xxxx - is a checksum generated by some secret algorithm
#
# http://www.lvportals.lv/visi/skaidrojumi/248652-personas-kods-ir-tava-identitate-sarga-to/
@voidius
voidius / gist:796f4bee740982fe3786
Created February 15, 2015 10:50
Remove Spotlight icon from menu bar in Yosemite
# to remove:
$ sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
# reboot
# to enable:
$ sudo chmod 755 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
# reboot
@voidius
voidius / enable_sql_output_in_rails_console.rb
Created December 9, 2014 10:21
Enable SQL output in Rails console
ActiveRecord::Base.logger = Logger.new(STDOUT)
package org.andengine.util.adt.io.out;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
/**
* TODO Instead of having mMaximumGrow there could be some kind of AllocationStrategy object.
*
* (c) 2011 Zynga Inc.
@voidius
voidius / reenable-pry.rb
Last active August 29, 2015 14:08
Reenable pry debugger on each request
class ApplicationController < ActionController::Base
before_action :enable_pry if Rails.env.development?
private def enable_pry
ENV['DISABLE_PRY'] = nil
end
end
@voidius
voidius / How to install tmux 1.9a on Redhat 6.5
Last active August 29, 2015 14:08
howto install tmux 1.9a on redhat 6.5
# source: http://superuser.com/questions/738829/attempting-to-install-tmux-on-centos-6-4-or-centos-6-5-fails-with-error-evbuff
yum -y install ncurses-devel
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure
make
make install