Skip to content

Instantly share code, notes, and snippets.


Leonard Kinday kinday

View GitHub Profile
jevakallio /
Last active Jul 7, 2021
#ReactiveConf 2017 Lightning Talk Submission: JavaScript Slam Poetry

TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please star this gist. If you're on mobile, you'll need to request desktop site.

JavaScript Slam Poetry

Javascript! Slam! Poetry!

gene1wood / all_aws_managed_policies.json
Last active Aug 13, 2021
A list of all AWS managed policies and they're policy documents as well as a short script to generate the list
View all_aws_managed_policies.json
This file has been truncated, but you can view the full file.
"APIGatewayServiceRolePolicy": {
"Arn": "arn:aws:iam::aws:policy/aws-service-role/APIGatewayServiceRolePolicy",
"AttachmentCount": 0,
"CreateDate": "2019-10-22T18:22:01+00:00",
"DefaultVersionId": "v6",
"Document": {
"Statement": [
sebmarkbage / Enhance.js
Last active Sep 11, 2021
Higher-order Components
View Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
componentDidMount() {
this.setState({ data: 'Hello' });
render() {
kazuho / gist:f15b79211ea76f1bf6e5
Last active Aug 29, 2015
Result of `h2o --help` (version 1.1.0)
View gist:f15b79211ea76f1bf6e5
h2o version 1.1.0
h2o [options]
-c, --conf FILE configuration file (default: h2o.conf)
-t, --test tests the configuration
-v, --version prints the version number
-h, --help print this help
addyosmani /
Last active Sep 15, 2021 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

sebmarkbage /
Last active Dec 27, 2020
New React Element Factories and JSX

New React Element Factories and JSX

In React 0.12, we're making a core change to how React.createClass(...) and JSX works.

If you're using JSX in the typical way for all (and only) React components, then this transition will be seamless. Otherwise there are some minor breaking changes described below.

The Problem

mistakster / cool-widget.css
Last active Aug 29, 2015
Example of the BEM-style mixins
View cool-widget.css
.cool-widget {
position: relative;
.cool-widget__title {
font: bold 20px/1 sans-serif;
.cool-widget__body {
font: normal 14px/1.4 sans-serif;
color: white;
benfrain / _tint-and-shade.scss
Created Nov 19, 2013
Tint and Shade functions for Sass
View _tint-and-shade.scss
// Add percentage of white to a color
@function tint($color, $percent){
@return mix(white, $color, $percent);
// Add percentage of black to a color
@function shade($color, $percent){
@return mix(black, $color, $percent);
WebEndevSnippets / functions.php
Created Oct 27, 2013
WordPress: Reduce Database Queries
View functions.php
Reduce database queries (
It is important to reduce unecessary queries to your database as each query take a few milliseconds to execute. First, you might want to know how many queries your blog execute in order to display a page. To do so, paste the code below in your functions.php file. Once done, just have a look to your site footer to know how many queries has been executed and how many time it took to completely load the page.
add_action( 'wp_footer', 'tcb_note_server_side_page_speed' );
function tcb_note_server_side_page_speed() {
date_default_timezone_set( get_option( 'timezone_string' ) );
$content = '[ ' . date( 'Y-m-d H:i:s T' ) . ' ] ';
$content .= 'Page created in ';
$content .= timer_stop( $display = 0, $precision = 2 );
$content .= ' seconds from ';