Skip to content

Instantly share code, notes, and snippets.

View ArunHub's full-sized avatar

Arun M ArunHub

View GitHub Profile
@ArunHub
ArunHub / Gulpfile.js
Last active January 22, 2019 12:07
Gulp file with tasks - sass, sassDoc, sourcemaps, browser-sync, run-sequence
var gulp = require('gulp'); // use gulp 3.9.0 only because in 4.0.0 version task assertion error coming.
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
var sourcemaps = require('gulp-sourcemaps');
var useref = require('gulp-useref');
var uglify = require('gulp-uglify');
var gulpIf = require('gulp-if');
var cssnano = require('gulp-cssnano');
var imagemin = require('gulp-imagemin');
var cache = require('gulp-cache');
@ArunHub
ArunHub / sublime shortcut keys
Last active March 28, 2019 14:49
Sublime text useful settings and shortcut keys
ctrl + r - to find css classes/IDs easily in a css file
ctrl + j - to align multiple lines into single line . mainly useful for single line css
ctrl + L - Select a line.
ctrl + D - Select a word/ duplicate a word or line(s)
ctrl + P - find any file on your project folder in fraction of second
ctrl + space - autocomplete for codes respectively
ctrl + / - comment purpose
ctrl + F - for normal search
ctrl + shift + F - Advanced search
ctrl + shift + G - wrap a text or codes
@ArunHub
ArunHub / alert the buttons text
Last active August 31, 2016 03:13
alert the buttons text
<div class="btns">
<p>Write JavaScript (using jQuery is fine) so that clicking on any button will cause an alert to popup with the text of the button that was clicked.</p>
<p>Make sure your solution is as efficient as possible even if there are a lot more <code>button.btn</code>'s added on the page. Do not use unnecessary event listeners.</p>
<button class="btn">c</button>
<button class="btn">l</button>
<button class="btn">o</button>
<button class="btn">s</button>
<button class="btn">e</button>
@ArunHub
ArunHub / alert-buttons.html
Last active July 7, 2018 09:44
alert the buttons text //source https://jsbin.com/fawepetaha
<div class="btns">
<p>Write JavaScript (using jQuery is fine) so that clicking on any button will cause an alert to popup with the text of the button that was clicked.</p>
<p>Make sure your solution is as efficient as possible even if there are a lot more <code>button.btn</code>'s added on the page. Do not use unnecessary event listeners.</p>
<button class="btn">c</button>
<button class="btn">l</button>
<button class="btn">o</button>
<button class="btn">s</button>
<button class="btn">e</button>
@ArunHub
ArunHub / another.css
Last active March 29, 2019 06:50
bootstrap hamburger menu for screw transformation
.navbar-toggle.expand .icon-bar:nth-child(4){
left: -25px;
opacity: 0;
}
.navbar-toggle.expand .icon-bar:nth-child(5){
left: 35px;
opacity: 0;
}
select.input-sm {
line-height: 20px;
}
.navbar-default{
background: none;
border: 0;
}
.navbar{
@ArunHub
ArunHub / navbarTabletMenuCollapse.css
Last active March 29, 2019 07:35
bootstrap navbar header collapse for Tablet >768 < 991 and bootstrap 3 tricks
.navbar-header {
float: none;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
@ArunHub
ArunHub / family.scss
Created December 1, 2016 06:08
some unique sass mixins
/// Select all children from the first to `$num`.
/// @group with-arguments
/// @content [Write the style you want to apply to the children, and it will be added within the @content directive]
/// @param {number} $num - id of the child
@mixin first($num) {
&:nth-child(-n + #{$num}) {
@content;
}
}
@ArunHub
ArunHub / routeconfig.js
Created February 12, 2018 16:25
multilevel UI-view routes
.config(function ($stateProvider, $urlRouterProvider){
$urlRouterProvider.otherwise("/home");
$stateProvider
//------------------------------
// HOME
//------------------------------
@ArunHub
ArunHub / breakStr.js
Created July 7, 2018 09:38
break string into array of strings whose length is given as input
function breakStr(string, count) {
//return [...string.slice(count - 1)].map((_, i) => string.slice(i, i + count));
return [Array.from(string).slice(count - 1)].map((_, i) => string.slice(i, i + count));
}