Skip to content

Instantly share code, notes, and snippets.

View beshur's full-sized avatar

Alex Buznik beshur

View GitHub Profile
@beshur
beshur / stuff.css
Created March 4, 2013 10:01
CSS misc stuff
/* misc useful stuff
Alex Buznik (http://buznik.com/) */
.b_catalog {
position: relative;
font: 0/0 a;
}
.b_catalog__el {
position: relative;
@beshur
beshur / notifyze.css
Last active December 14, 2015 12:29
jQuery notifyze
// Simple side nofitication
// cc Alex Buznik, 2013
// demo: http://jsfiddle.net/beshur/mr3DV/
.b_notifyze {
position: fixed;
z-index: 110;
top: 0;
right: 0;
}
@beshur
beshur / placeholder.js
Created March 13, 2013 09:17
jQuery input placeholder fix
placeholderSupport = ("placeholder" in document.createElement("input"));
if(!placeholderSupport ){
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
ABACAS => #ABACA5
ABASED => #ABA5ED
ABASES => #ABA5E5
ABBESS => #ABBE55
ABODED => #AB0DED
ABODES => #AB0DE5
ACCEDE => #ACCEDE
ACCESS => #ACCE55
ADOBES => #AD0BE5
ADOBOS => #AD0B05
@beshur
beshur / b_select.css
Last active December 15, 2015 19:18
jQuery styled select js
.b_select {
position: relative;
display: block;
margin-top: 1px;
margin-right: 29px;
padding: 0;
color: #000;
font-size: 12px;

jQuery Caret

This is a very simple lightweight plugin to allow you to move the caret (or cursor) position in an <input /> or <textarea> element.

By exposing three jQuery.fn methods you can easily move a a caret to any position you like:

$.fn.caretTo( index , [ offset ] )

Tutorial: Meteor in Windows using Vagrant

These days some people were discussing at meteor-talk group about running Meteor at Windows and I’ve recommended them using Vagrant. It’s a very developer-friendly piece of software that creates a virtual machine (VM) which let you run any operating system wanted and connect to it without big efforts of configuration (just make the initial installation and you have it working).

Many packages (I've tested) for running Meteor+Vagrant fails because Meteor writes its mongodb file and also other files inside local build folder into a shared folder between the Windows host and the Linux guest, and it simply does not work. So I've put my brain to work and found a solution: do symlinks inside the VM (but do not use ln. Use mount so git can follow it). It’s covered on steps 8 to 15.

If you have no idea what I’m talking about, I’ve made a tutorial to install Ubuntu Precise x86 through Windows command-line with Meteor very simple to follow

@beshur
beshur / index.html
Last active December 27, 2015 23:19
HTML basic bootstrap
<!DOCTYPE html>
<html>
<head>
<title>index</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
html, body {
@beshur
beshur / scroll.js
Created November 19, 2013 09:46
jQuery check if element is scrolled to (close to Bootstrap affix)
window.page_var = {};
window.onload = function() {
$(".b_screens__el").each(function (i) {
page_var.screens[i] = $(this).offset().top;
})
}
$(window).resize(function() {
$(".b_screens__el").each(function (i) {
page_var.screens[i] = $(this).offset().top;
})
@beshur
beshur / blockPosition.js
Last active December 29, 2015 17:39
jQuery blockPosition
// jQuery function to center the image and stretch it to completely fill
// the parent, stretchin either height or width, when needed
//
// originally written by Ivan Ryzhenko
// https://gist.github.com/beshur/7706062
//
// Usage:
// blockPosition($(img_you_need_to_center), $(optional_relative));
function blockPosition(obj, relative){
obj.each(function(index, element) {