Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.
This file contains 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
import React, { useState, useEffect, useCallback } from 'react' | |
function Posts() { | |
const [isLoading, setIsLoading] = useState(true) | |
const [posts, setPosts] = useState([]) | |
const fetchPosts = useCallback(async controller => { | |
try { | |
// Imagine that the fetch is going to take 3 seconds to finish | |
await new Promise(resolve => setTimeout(resolve, 3000)) |
This file contains 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
[user] | |
name = Pavan Kumar Sunkara | |
email = [email protected] | |
username = pksunkara | |
[core] | |
editor = vim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
pager = delta | |
[sendemail] | |
smtpencryption = tls |
This file contains 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
// Tests built around our Storybook | |
describe('Storybook', () => { | |
beforeEach(() => { | |
// Visiting our app before each test removes any state build up from | |
// previous tests. Visiting acts as if we closed a tab and opened a fresh one. | |
// In this case, we are using the publicly accessible AirBnB react-dates Storybook | |
cy.visit('http://airbnb.io/react-dates/') | |
}) | |
// Let's build some tests around the DateRangePicker | |
context('DateRangePicker', () => { |
This file contains 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 os = require("os"); | |
//Create function to get CPU information | |
function cpuAverage() { | |
//Initialise sum of idle and time of cores and fetch CPU info | |
var totalIdle = 0, totalTick = 0; | |
var cpus = os.cpus(); | |
//Loop through CPU cores |
Douglas Crockford, author of JavaScript: The Good parts, recently gave a talk called The Better Parts, where he demonstrates how he creates objects in JavaScript nowadays. He doesn't call his approach anything, but I will refer to it as Crockford Classless.
Crockford Classless is completely free of class, new, this, prototype and even Crockfords own invention Object.create.
I think it's really, really sleek, and this is what it looks like:
function dog(spec) {
This file contains 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
/** | |
* Using Operator Mono in Atom | |
* | |
* 1. Open up Atom Preferences. | |
* 2. Click the “Open Config Folder” button. | |
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up. | |
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden! | |
* 5. Tweak away. | |
* | |
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png): |
This file contains 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
/* This is a technique to lazy load your javascript files | |
* Handy for those pesky slow, load blocking off-site scripts | |
* function lazyLoad | |
* @s: String of path to file | |
*/ | |
function lazyLoad(s) { | |
var d = window.document; | |
var b = d.body; /* appends at end of body, but you could use other methods to put where you want */ | |
var e = d.createElement('script'); |
This file contains 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 | |
#Vars | |
web_service='nginx' | |
config_path='/usr/local/letssl/' | |
le_path='/opt/letsencrypt' | |
exp_limit=20; | |
#Func | |
function check_ssl { |
NewerOlder