Skip to content

Instantly share code, notes, and snippets.

View davidlivingrooms's full-sized avatar

Bizbee davidlivingrooms

View GitHub Profile
function throttle( fn, time ) {
var t = 0;
return function() {
var args = arguments, ctx = this;
clearTimeout(t);
t = setTimeout( function() {
fn.apply( ctx, args );
}, time );
};
@davidlivingrooms
davidlivingrooms / uri.js
Created October 16, 2015 22:12 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@davidlivingrooms
davidlivingrooms / create_user_with_privs.sql
Created October 17, 2015 23:06
Add new postgresql user with privs
CREATE USER openmicer;
GRANT ALL PRIVILEGES ON database openmicnight TO openmicer;
GRANT ALL PRIVILEGES ON openmic TO openmicer;
@davidlivingrooms
davidlivingrooms / file 2
Last active June 30, 2017 03:31 — forked from tommaitland/form.html
A form with every HTML form element (up to HTML5) for styling.
asdf

Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

This is where any fun you might have been having ends. Now it’s time to get serious and talk about rules.

Writing CSS is hard. Even if you know all the intricacies of position and float and overflow and z-index, it’s easy to end up with spaghetti code where you need inline styles, !important rules, unused cruft, and general confusion. This guide provides some architecture for writing CSS so it stays clean and ma

@davidlivingrooms
davidlivingrooms / react-terminology.md
Created October 20, 2015 18:11 — forked from sebmarkbage/react-terminology.md
React (Virtual) DOM Terminology
'use strict';
var React = require('react');
var ReactComponentName = React.createClass({
getDefaultProps: function() {
return {
};
@davidlivingrooms
davidlivingrooms / debugTimeout.js
Created July 14, 2016 15:59
debugging disapearing dom elements
setTimeout(function(){debugger}, 5000)
@davidlivingrooms
davidlivingrooms / reactClassMinimum
Last active July 3, 2017 04:07
[React class minimum] A barebones es6 React class template #React
import React from 'react'
export default class {{gist_replace}} extends React.Component {
static propTypes = {
}
render() {
return (