Skip to content

Instantly share code, notes, and snippets.


Rohan Shewale ron4stoppable

Block or report user

Report or block ron4stoppable

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ron4stoppable / scrollTop.js
Last active Dec 23, 2018
Get proper scroll/page-offset value, works in all browsers, over all platforms (as far as I have tested)
View scrollTop.js
// to get proper scroll/page-offset value
// works in all browsers, over all platforms (as far as I have tested)
// this basically is for the different property in iOS browser & Safari
const scrollTop = Math.max(window.pageYOffset, document.documentElement.scrollTop, document.body.scrollTop);
ron4stoppable /
Created Nov 10, 2018
A tokenizer class for MultiAutoCompleteTextView, with text seperated with space.
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextUtils;
import android.widget.MultiAutoCompleteTextView;
public class SpaceTokenizer implements MultiAutoCompleteTextView.Tokenizer {
public int findTokenStart(CharSequence text, int cursor) {
int i = cursor;
ron4stoppable / moveElementLocationInArray.js
Created Oct 26, 2018
The function move's an element in array `arr` from index `fromIndex` to index `toIndex`
View moveElementLocationInArray.js
function arraymove(arr, fromIndex, toIndex) {
var element = arr[fromIndex];
arr.splice(fromIndex, 1);
arr.splice(toIndex, 0, element);
ron4stoppable / moz-webkit.css
Created Jul 30, 2018 — forked from nathansmith/moz-webkit.css
Target Firefox and WebKit via hacky CSS.
View moz-webkit.css
Read more here:
For more browser-specific hacks:
@-moz-document url-prefix() {
/* Put your Firefox specific code here. */
View footer-barrier-animation.css
ron4stoppable / toUp.html
Created Apr 6, 2017
Simple "Scroll to Up" button with jQuery
View toUp.html
CSS style to make the button stick to bottom of page
#toUp {
position: fixed;
right: 5px;
bottom: 15px;
ron4stoppable / _imageOutlineComp.css
Created Dec 30, 2016
border (frame) overlay and inset on image
View _imageOutlineComp.css {
display: inline-block;
position: relative;
} {
display: block;
content: '';
position: absolute;
top: 4px;
ron4stoppable / serialObj.js
Created Nov 10, 2016
Serialize form data to object [jQuery]
View serialObj.js
// serializing the inputs to object
$.fn.serializeObject = function()
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[] !== undefined) {
if (!o[].push) {
o[] = [o[]];
ron4stoppable / httpd-vhosts.cofig
Created Oct 4, 2016
Virtual host configuration for Apache, with example from Windows environment
View httpd-vhosts.cofig
# Virtual host configuration for apache
# Windows location : C:\xampp\apache\config\extra\httpd-vhosts.config
# incase you have installed in some other stack or installed in other location, find in appropriate directory
# after setting up the httpd-vhosts.config, add the site name to hosts file located at
# 'C:\Windows\System32\drivers\etc\hosts' , it is a text file with no extension, if it do not exist, create the file.
# and your site's name at the end of it -
ron4stoppable / get-db.php
Created Sep 16, 2016
Detect and connect to db server with proper configuration. The code check if the web app is hosted at localhost or a web server and load proper db configuration.
View get-db.php
$local = array(
); // localhost
if(!in_array($_SERVER['REMOTE_ADDR'], $local)){
require_once('connection-db.php'); // db connection details for server
require_once('db-connect-local.php'); // db connection details for localhost
You can’t perform that action at this time.