Skip to content

Instantly share code, notes, and snippets.

View rvgpl's full-sized avatar
🖖

Ravigopal Kesari rvgpl

🖖
View GitHub Profile
@rvgpl
rvgpl / solarized-colors.md
Created January 31, 2023 06:27 — forked from ninrod/solarized-colors.md
Solarized Dark values on different color palettes

Solarized Dark values on different color palettes

SOLARIZED HEX 16/8 TERMCOL XTERM HEX L*A*B RGB HSB GNU screen
base03 #002b36 8/4 brblack 234 #1c1c1c 15,-12,-12 0,43,54 193,100,21 K
base02 #073642 0/4 black 235 #262626 20,-12,-12 7,54,66 192,90,26 k
base01 #586e75 10/7 brgreen 240 #585858 45,-07,-07 88,110,117 194,25,46 G
base00 #657b83 11/7 bryellow 241 #626262 50,-07,-07 101,123,131 195,23,51 Y
base0 #839496 12/6 brblue 244 #808080 60,-06,-03 131,148,150 186,13,59 B
base1 #93a1a1 14/4 brcyan 245 #8a8a8a `65,-05
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
font-family: inherit;
font-size: 24px;
line-height: 2;
max-width: 500px;
margin: 0 auto;
@rvgpl
rvgpl / get.es6.js
Created August 2, 2018 16:00
deeply nested values
const get = (obj, path) => path.reduce((acc, value) => (acc && acc[value] ? acc[value] : null), obj);
//get(object, ['level1', 'level2','level3'])
const get1 = path => obj => path.reduce((acc, value) => (acc && acc[value] ? acc[value] : null), obj);
// get1(['level1', 'level2','level3'])(object)
// const getItems = get1(['level1', 'level2','level3']);
// getItems(object)
@rvgpl
rvgpl / debug.jsx
Created March 17, 2018 15:35
debugging react props
{
(() => {
debugger;
this.props;
})();
}
// Drop this IIFE in the jsx of any React compoent to quickly check for props or state using Chrome dev tools.
@rvgpl
rvgpl / richhickey.md
Created October 23, 2017 04:30 — forked from prakhar1989/richhickey.md
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@rvgpl
rvgpl / FlowTutorial.js
Created October 16, 2017 03:18 — forked from busypeoples/FlowTutorial.js
Flow Fundamentals For JavaScript Developers
// @flow
// Flow Fundamentals For JavaScript Developers
/*
Tutorial for JavaScript Developers wanting to get started with FlowType.
Thorough walkthrough of all the basic features.
We will go through the basic features to gain a better understanding of the fundamentals.
You can uncomment the features one by one and work through this tutorial.
var canUseDOM = !!(
typeof window !== 'undefined' &&
window.document &&
window.document.createElement);
if(canUseDOM) {
//Do Window things
}
else {
@rvgpl
rvgpl / breakpoint-mixin.scss
Created September 12, 2017 03:30
A SASS mixin for breakpoints
@mixin breakpoint($point) {
@if $point == desktop {
@media (min-width: 75em) { @content; }
}
@else if $point == tablet {
@media (min-width: 48em) { @content; }
}
@else if $point == phone {
@media (min-width: 20em) { @content; }
}
@rvgpl
rvgpl / loadSlides.css
Last active June 20, 2017 11:15
Gracefully load slides when using Slick carousel
.carousel {
visibility:hidden;
opacity:0;
transition: opacity 1s;
}
.carousel.slick-initialized{
visibility:visible;
opacity:1;
}
@rvgpl
rvgpl / copyText.html
Last active May 30, 2017 04:13
Replaces copied text with a link to the page it is copied from, limits chars to 100
<script>
document.addEventListener('copy', function(e) {
var pageLink = '\n\n Read more at: ' + document.location.href;
var modifiedText = window.getSelection().toString().length > 100 ? window.getSelection().toString().substring(0,100) + pageLink : window.getSelection().toString() + pageLink;
if (e.clipboardData) {
e.clipboardData.setData('Text', modifiedText);
}
e.preventDefault();
});