Skip to content

Instantly share code, notes, and snippets.

View tushar-borole's full-sized avatar
🎯
Working on React

Tushar Borole tushar-borole

🎯
Working on React
View GitHub Profile
@tushar-borole
tushar-borole / _spacing-helpers.scss
Created October 24, 2019 23:03 — forked from jacurtis/_spacing-helpers.scss
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@tushar-borole
tushar-borole / iterm2-oh-my-fish.md
Created January 15, 2019 18:32 — forked from leymannx/iterm2-oh-my-fish.md
iTerm2 Solarized Dark theme + Fish shell + oh-my-fish /// macOS High Sierra
@tushar-borole
tushar-borole / iterm2-solarized.md
Last active July 19, 2018 17:56 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

<?php
/**
* Use * for origin
*/
add_action( 'rest_api_init', function() {
remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' );
add_filter( 'rest_pre_serve_request', function( $value ) {
header( 'Access-Control-Allow-Origin: *' );
header( 'Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE' );
@tushar-borole
tushar-borole / image-aspect-ratio.js
Created December 1, 2015 20:14 — forked from jabranr/image-aspect-ratio.js
Set image aspect ratio with JavaScript
/**
* Originally wrote this snippet for Suffragette/Pathé campaign (https://apps.facebook.com/inspiring-women)
*
* The campaign app forms a grid of square images pulled from social APIs based on
* particular hashtags. This snippet sets the new width and
* height based on their natural width and height to maintain the aspect ratio.
* Works best for 1:1 aspect ratio but can be modified to accommodate other ratio.
*
* @param Element|Resource img - An image element/resource from DOM
* @param int expected - Expected width or height
@tushar-borole
tushar-borole / Gruntfile.js
Created November 25, 2015 07:35 — forked from nnarhinen/Gruntfile.js
Support html5 pushState (or angular.js html5mode) in a yeoman (grunt-contrib-connect) application.
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
//MODIFIED: add require for connect-modewrite
var modRewrite = require('connect-modrewrite');
grunt.initConfig({
//The connect.options.middleware is the relevant part
//Adapted from https://github.com/yeoman/generator-angular/issues/433#issuecomment-37706899
// Generated on 2014-01-30 using generator-angular 0.7.1
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
@tushar-borole
tushar-borole / filter-blur.css
Created November 6, 2015 14:09
Cross-browser Filter Blur CSS
filter: blur(5px); /* Someday, sigh ... */
-webkit-filter: blur(5px); /* Prefixed CSS3 blur filters */
-moz-filter: blur(5px);
-o-filter: blur(5px);
-ms-filter: blur(5px);
/* filter: url(#blur); Firefox needs SVG */
filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius='10'); /* IE lte 9 */
@tushar-borole
tushar-borole / checkImage.example.js
Created October 15, 2015 11:51 — forked from draeton/checkImage.example.js
Check the existence of an image file at `url` by creating a temporary Image element.
// Example Use
(function () {
function success() {
console.log("success: ", this.src);
}
function failure() {
console.log("failure: ", this.src);
}
@tushar-borole
tushar-borole / traverse.js
Last active July 30, 2024 00:40 — forked from steinfletcher/traverse.js
Object tree traversal in javascript (with lodash)
var data = {
"name": "root",
"contents": [
{
"name": "A",
"contents": [
{
"name": "fileA1",
"contents": []
}