Skip to content

Instantly share code, notes, and snippets.

@mrmrs
mrmrs / count-all-elements.js
Created August 23, 2013 00:24
List all elements on a page. Using this a lot for css performance testing sites I don't have source for locally.
document.getElementsByTagName("*").length
@kristoferjoseph
kristoferjoseph / Kal_El.vim
Last active January 4, 2016 02:19
Super vim color scheme
" Vim color file - Kal_El
" @dam <3's you
set background=dark
if version > 580
hi clear
if exists("syntax_on")
syntax reset
endif
endif
@mrmrs
mrmrs / designer-koans.md
Last active April 9, 2016 09:24
The ultimate definitive guide on whether or not designers should code

Designer Koans

No ultimate difference

One day a designer visited Master HyperTextCascade, and inquired, “Master, how will my designs be different when I have mastered code?”

Master HyperTextCascade answered, “Before code: identify problem, research, test, ship, iterate, solve problem. After code: identify problem, research, test, ship, iterate, solve problem.”

How do you make a Media component in React?

var Media = React.createClass({

});

We then need to export our component so it can be used outside this file.

@agendor
agendor / hapijs-rest-api-tutorial.md
Last active August 31, 2021 08:31
A practical introduction to building a RESTful API with the hapi.js server framework for Node.js

Add Authentication with Auth0 to a Gatsby site

All the pieces of authentication are possible in Gatsby. Thanks to Auth0, setting it up doesn't have to be so cumbersome!

This setup comes straight from Auth0's official quick start for React.


The first step is installing the official Auth0 SDK for JavaScript from npm.

@chuanxshi
chuanxshi / mobile tags for your '<head>'
Created March 1, 2011 14:56
mobile tags for your '<head>'
<!doctype html>
<!-- Helpful things to keep in your <head/>
// Shi Chuan, https://github.com/shichuan/mobile-html5-boilerplate
-->
<head>
<!-- consider using below meta tags if you want to disable format detection by default -->
<meta name="format-detection" content="telephone=no"/>
<meta name="format-detection" content="address=no"/>
<!-- consider using below link tag if the page is duplicate content of a desktop version -->
@razwan
razwan / _baseline.scss
Created April 14, 2014 16:20
Aligning type to baseline the right way with SASS
$base-font-size: 16px;
$base-line-height: 1.5;
// this value may vary for each font
// unitless value relative to 1em
$cap-height: 0.68;
@mixin baseline($font-size, $scale: 2) {
@threepointone
threepointone / glam-for-css-folks.md
Last active September 4, 2022 07:43
why css purists will love glam

I made a little styling lib called glam

(some features are in development)

one

let's start off with the simplest use case. we'll make an 'index.html' page, and assume we've setup our js bundler to output bundle.js

@jhjguxin
jhjguxin / creating-nested-resources-in-ruby-on-rails-3-and-updating-scaffolding-links-and-redirection.markdown
Created July 9, 2012 03:32
Creating nested resources in ruby on rails 3 and updating scaffolding links and redirection