Skip to content

Instantly share code, notes, and snippets.

@likerRr
likerRr / jquery_horizontal_scroll
Created May 8, 2015 07:56
jQuery horizontal scroll
$('#el').bind('DOMMouseScroll mousewheel', function(e) {
var step = 30;
e.preventDefault();
step *= (e.originalEvent.wheelDelta > 0) ? -1 : 1;
$(this).scrollLeft($(this).scrollLeft() + step);
});
@likerRr
likerRr / hedisql-ssh-connect
Created April 16, 2015 21:53
How to connect to HediSQL via ssh
proof: http://www.heidisql.com/forum.php?t=167
---------------------------------------------------------------------------------------------
I just tried to connect to my MySQL using putty.. It works great...
First download Putty (google on putty) then create a new connection.
Go to "Connection -> SSH -> Tunnels" in the left part of the screen and input the following:
Source port: 3306
Destination: localhost:3306
(The radiobuttons stay on "local" and "auto")
Then press the "Add" button.
@likerRr
likerRr / dot-notation-object.js
Last active October 31, 2016 12:48
Adding string with dot-notation as a key to JavaScript objects
// Be careful when changing Object's prototype to avoid overwriting of methods
if (Object.prototype.setPath === undefined && Object.prototype.getPath === undefined) {
Object.prototype.setPath = function (path, value, notation) {
function isObject(obj) { return (Object.prototype.toString.call(obj) === '[object Object]' && !!obj);}
notation = notation || '.';
path.split(notation).reduce(function (prev, cur, idx, arr) {
var isLast = (idx === arr.length - 1);
// if <cur> is last part of path
if (isLast) return (prev[cur] = value);
@likerRr
likerRr / 0_reuse_code.js
Created July 29, 2014 08:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console