Skip to content

Instantly share code, notes, and snippets.

😎
LaravelLive

Rohan Shewale ron4stoppable

😎
LaravelLive
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
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
ron4stoppable / SpaceTokenizer.java
Created Nov 10, 2018
A tokenizer class for MultiAutoCompleteTextView, with text seperated with space.
View SpaceTokenizer.java
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextUtils;
import android.widget.MultiAutoCompleteTextView;
public class SpaceTokenizer implements MultiAutoCompleteTextView.Tokenizer {
@Override
public int findTokenStart(CharSequence text, int cursor) {
int i = cursor;
@ron4stoppable
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
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:
https://developer.mozilla.org/en/CSS/@-moz-document
For more browser-specific hacks:
http://paulirish.com/2009/browser-specific-css-hacks
*/
@-moz-document url-prefix() {
/* Put your Firefox specific code here. */
View footer-barrier-animation.css
@ron4stoppable
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
-->
<style>
#toUp {
position: fixed;
right: 5px;
bottom: 15px;
display:none;
}
@ron4stoppable
ron4stoppable / _imageOutlineComp.css
Created Dec 30, 2016
border (frame) overlay and inset on image
View _imageOutlineComp.css
div.ie-container {
display: inline-block;
position: relative;
}
div.ie-container:before {
display: block;
content: '';
position: absolute;
top: 4px;
@ron4stoppable
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[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
@ron4stoppable
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 -
# 127.0.0.1 laravel.dev
# 127.0.0.1 mysite.dev
@ron4stoppable
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(
'127.0.0.1',
'::1'
); // localhost
if(!in_array($_SERVER['REMOTE_ADDR'], $local)){
require_once('connection-db.php'); // db connection details for server
}
else{
require_once('db-connect-local.php'); // db connection details for localhost
You can’t perform that action at this time.