Skip to content

Instantly share code, notes, and snippets.

Avatar

Surender Lohia SurenderLohia

View GitHub Profile
@SurenderLohia
SurenderLohia / scss-mixin-for-rem-font-sizing.md
Last active Sep 17, 2016
SCSS Mixin for rem font sizing with px fallback for older browsers
View scss-mixin-for-rem-font-sizing.md

CSS

  
    html {
      font-size: 16px; /* Sets up the Base font size */
    }
  

SCSS

@SurenderLohia
SurenderLohia / Gulpfile.js
Created Oct 14, 2016
Simple, gulp config.
View Gulpfile.js
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
var cssnano = require('cssnano');
gulp.task('js', function() {
gulp.src('app/js/*.js')
.pipe(concat('script.js'))
@SurenderLohia
SurenderLohia / clipboard.js-size.md
Last active Aug 4, 2017
Clipboard.js and ZeroClipboard size comparison
View clipboard.js-size.md
Name Minified Minified + Gzipped Download Over 2G Download Over 3G Dependencies
ZeroClipboard 31.2 kB 9.9 kB 0.31 s 0.19 s 0
clipboard.js 9.53 kB 2.97 kB 0.09 s 0.06 s 3

Note: ZeroClipboard requires flash support. While clipboard.js not required flash.

View main.css
/* css/main.css */
body {
margin: 0;
}
.wrap {
max-width: 600px;
margin-left: auto;
margin-right: auto;
padding-left: 20px;
View main.js
// IIFE to create local scope and to avoid global namespacing collisions
(function () {
let todoCollection = {};
let todoIds = [];
/*
Data Structure:
const todoCollection = {
"1": {
@SurenderLohia
SurenderLohia / index.html
Last active Aug 13, 2020
Todo App section
View index.html
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Todo App</title>
</head>
<body>
<h2>Todo App</h1>