Skip to content

Instantly share code, notes, and snippets.

View SurenderLohia's full-sized avatar

Surender Lohia SurenderLohia

View GitHub Profile
const students = [
{
id: '1',
isSelected: true,
name: 'Mike',
},
{
id: '2',
isSelected: false,
name: 'Jane',
const students = [
{
id: '1',
isSelected: true,
name: 'Mike',
},
{
id: '2',
isSelected: false,
name: 'Jane',
// 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 August 13, 2020 15:05
Todo App section
<!-- 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>
/* css/main.css */
body {
margin: 0;
}
.wrap {
max-width: 600px;
margin-left: auto;
margin-right: auto;
padding-left: 20px;
@SurenderLohia
SurenderLohia / clipboard.js-size.md
Last active August 4, 2017 09:05
Clipboard.js and ZeroClipboard size comparison
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.

@SurenderLohia
SurenderLohia / Gulpfile.js
Created October 14, 2016 11:23
Simple, gulp config.
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 / scss-mixin-for-rem-font-sizing.md
Last active September 17, 2016 15:37
SCSS Mixin for rem font sizing with px fallback for older browsers

CSS

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

SCSS