Skip to content

Instantly share code, notes, and snippets.

04jSf
N3q8ryccAASZlUzG8AUAAAAAAAA/AAAAAAAAAAb1LRfMCD3Tk4E/eTorx3bb2Zpc2GiaNuq8qTJ7
Tc+Ez61FLccc+Q9Jz3bXY6Yz95tzjOUGmqhJMucH9zSa8LNL4jgeOwu89Dfe42ffkhTpcQUP0uh5
YVeb9aPTGU9/u4+X+fYCH6fsEslSswzKil2eZXaifuPCoC8igQ/9aaaxv9viM25lCkd/0s2mMISH
PBTubF8p3t3hKKGEMq473xF+SfmvMOOchS8PbmjDhNSbAIewr2tDGDOvBxrpXeXWp7gcXkqRfFAM
hp/vHbqeWhsvBzv+z+Mo9dgn2uWfD3TfF6VKeA8Un3vGtOMvVSFkX9eoxvz+K11DfBn1EaGvmRx1
w+elzy2ygkurXGnTjdUDhWcDblTw8wX9yFpIEnOjWWAKFBdP+U3cFh7LLbBqdS8Rb8n1tt5UfDRb
SCAtfQbOyyJR1oKulxo0PBJfqGUHauRPqbMf+ldOeyr3vnKdGNb3l6FJbb5FuJDNXpGImTUlQTIj
+/mOy9UPHin/FweqgPzh9rALzPcVeYhglIFeI3/4zRuApcJwlllC/X4TiNtzC3pwXc0/VeSKnsMt
ZzogNGFTMSAvIGpKYlMyMwp5OiBqMVNGCm06IGYwajEKcjogYVNqCm1pOiBKQjBGCm0vYS9tOiBz
MCAvIDBiUyAvIGJCajIzCnlncjogZ2FtPVNqQjIyCgpiOiA0MC1FUDdiIEpBRiA3NTlzRjRiIDBm
Qjc1OTIzIDBmNzU5SjIyIEZBSjIyIDY4NS9qQmokJDI0Cg==
NzdCNTogMTMzMDEyLTIyNDAwNC02MDY0NTItNjIxNTk5DQo2Qzk0OiA0ODI5MTEtMzM5ODY3LTA5
ODE1My0wMDI1ODUNCg==
@ales-vilchytski
ales-vilchytski / rc.local
Created October 28, 2016 10:45
Mount VBox shared folder automatically
# in /etc/rc.local
mount -t vboxsf workspace /home/ales/workspace
mount -t vboxsf usr /home/ales/wine
exit 0
@ales-vilchytski
ales-vilchytski / bashrc_misc.md
Last active April 25, 2016 08:54
Useful bash misc functions and settings

Bash prompt like in msysgit:

function parse_git_branch () {
  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}

RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
@ales-vilchytski
ales-vilchytski / browserconfig.md
Last active February 15, 2016 17:47
Firefox and Chrome settings for development and browsing at the same time

Firefox web-development setup on Windows

Run separate FF profile (allows to completely separate settings for profiles, very useful when FF is your main browser):

  • Close all FF instances and run firefox -P
  • Create profiles as needed
  • To run FF in standalone mode with selected profile run (or update shorcut): firefox -p "ProfileName" --no-remote

If you want to run different versions of FF you will need different profiles.

@ales-vilchytski
ales-vilchytski / msysgit-1.9-config-win.md
Last active August 29, 2015 14:24
msysgit-1.9-config-win

.gitconfig

Using notepad++ as editor, tortoisesvn tools for diff and merge

[gui]
	encoding = utf-8
[user]
	email = # don't forget
	name = # don't forget
@ales-vilchytski
ales-vilchytski / browser.misc.js
Created March 18, 2015 06:38
JS browser markup debug helpers
// Mouse events emulation
var dispatchMouseEvent = function(target, var_args) {
var e = document.createEvent("MouseEvents");
// If you need clientX, clientY, etc., you can call
// initMouseEvent instead of initEvent
e.initEvent.apply(e, Array.prototype.slice.call(arguments, 1));
target.dispatchEvent(e);
};
dispatchMouseEvent(document.getElementById('dijit_form_TextBox_10'), 'mousedown', true, true);

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@ales-vilchytski
ales-vilchytski / Gemfile
Last active August 29, 2015 14:13
Mongoid 4.0.0 accept_nested_attributes_for issue (#3920)
gem 'mongoid', '4.0.0'
@ales-vilchytski
ales-vilchytski / Gemfile
Last active August 29, 2015 14:04
Haml 4.0 thread safety issue in JRuby
# A sample Gemfile
source "https://rubygems.org"
gem 'haml', "4.0.5"
gem 'nokogiri'