Skip to content

Instantly share code, notes, and snippets.

@kirnovak
kirnovak / tmux.conf
Created April 14, 2018 14:01 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@kirnovak
kirnovak / namespaces.js
Created May 15, 2015 04:04
ns() - namespaces for javascript
function ns (namespase) {
var parts = namespase.split('.'),
parent,
i;
if ( window.hasOwnProperty(parts[0]) === false ) {
window[parts[0]] = {};
}
var random = function(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
$(document).mouseup(function (e) {
var container = $("YOUR CONTAINER SELECTOR");
if (container.has(e.target).length === 0)
{
container.hide();
}
});
String.prototype.times = function(n) {
return Array.prototype.join.call({length: n+1}, this);
};
var star = '<div class="star" />'.times(12);
$('body').append(star);
ActiveRecord::Base.connection.execute("SELECT * FROM users")
ActiveRecord::Base.connection.execute("select * from customers").fetch_row
results = ActiveRecord::Base.connection.execute("select * from customers")