A Pen by Rahul Raghavan on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LazyVideoLoader { | |
| constructor() { | |
| this.videos = [].slice.call(document.querySelectorAll('.hero__bgvideo')); | |
| // Abort when: | |
| // - The browser does not support Promises. | |
| // - There no videos. | |
| // - If the user prefers reduced motion. | |
| // - Device is mobile. | |
| if ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "_description: Name of City, or Town": { | |
| "State": "The Indian State under which this City/Town exists.", | |
| "GeoCode": [ | |
| "Latitude", | |
| "Longitude" | |
| ], | |
| "PinCodes": [ | |
| "All", | |
| "The", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Get postman app | |
| wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz | |
| sudo tar -xzf postman.tar.gz -C /opt | |
| sudo ln -s /opt/Postman/Postman /usr/bin/postman | |
| #Create a Desktop Entry | |
| cat > ~/.local/share/applications/postman.desktop <<EOL | |
| [Desktop Entry] | |
| Encoding=UTF-8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bash | |
| wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz | |
| sudo tar -xzf postman.tar.gz -C /opt | |
| sudo ln -s /opt/Postman/Postman /usr/bin/postman | |
| #Create a Desktop Entry | |
| cat > ~/.local/share/applications/postman.desktop <<EOL | |
| [Desktop Entry] | |
| Encoding=UTF-8 | |
| Name=Postman |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Date.prototype.getWeek = function () { | |
| var onejan = new Date(this.getFullYear(), 0, 1); | |
| return Math.ceil((((this - onejan) / 86400000) + onejan.getDay() + 1) / 7); | |
| }; | |
| var myDate = new Date("2001-02-02"); | |
| myDate.getWeek(); //=> 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var XLSX = require('xlsx') | |
| function Workbook() { | |
| this.SheetNames = ['Report']; | |
| this.Sheets = {}; | |
| } | |
| var wb = new Workbook(); | |
| var ws = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MIT License | |
| Copyright (c) 2015 Kaleb Fulgham | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| ##Device = Desktops | |
| ##Screen = 1281px to higher resolution desktops | |
| */ | |
| @media (min-width: 1281px) { | |
| //CSS | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const expenseFormPlugin = (state, action) => { | |
| if (action.type === '@@redux-form/CHANGE' && action.meta && action.meta.form === 'expenseForm' && action.meta.field) { | |
| if (action.meta.field === 'time' || action.meta.field === 'rate') { | |
| const time = state.values.time? parseInt(state.values.time, 10) : 0 | |
| const rate = state.values.rate ? parseInt(state.values.rate, 10): 0 | |
| const total = time * rate | |
| return { | |
| ...state, | |
| values: { | |
| ...state.values, |
NewerOlder