Skip to content

Instantly share code, notes, and snippets.

// Create a simple top to bottom linear gradient with a background-color backup
// The first argument, $color will be output as background-color: $color
//
// This yields a gradient that is 5% brighter on the top and 5% darker on the bottom
//
// +gradient-bg(#777)
//
// This yeilds a gradient where the bright and dark colors are shifted 10% from the original color.
// If you don't specify a third argument it will assign this value for the darkness too, keeping the gradient even.
//
@JeffreyWay
JeffreyWay / DogsController.php
Last active December 11, 2015 20:08
Testable Laravel.
<?php
class DogsController extends BaseController {
protected $db;
// Let the db-layer be injected. Don't worry...
// Laravel will automatically inject the dependencies for you.
function __construct(DogInterface $db) {
$this->db = $db;
}

Sarah Parmenter

There is no set-out workflow for responsive design yet - everyone is 'winging it'

Photoshop has become a dirty word, but it still has its place

Questionnaire

  • 56% of people said workflow has completely changed
  • 64% of people are integrating is as part of service, not additional feature
  • 65% of people work to common breakpoints
@micahgodbolt
micahgodbolt / sassbites7.scss
Created September 12, 2013 18:49
SassBites#7 Code
$foo: 1;
$bar: 6;
@while $foo < $bar {
h#{$foo} { // do something
font-size: ($bar - $foo)+em;
}
$foo: $foo + 1; // advance a counter
}
@thefuxia
thefuxia / t5-silent-flush.php
Last active August 11, 2016 11:03
T5 Silent Flush - Flushes rewrite rules whenever a custom post type or taxonomy is registered and not already part of these rules. This is a soft flush, the .htaccess will not be rewritten.
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Silent Flush
* Description: Flushes rewrite rules whenever a custom post type or taxonomy is registered and not already part of these rules. This is a soft flush, the .htaccess will not be rewritten.
* Version: 2013.05.04
* Author: Thomas Scholz <info@toscho.de>
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*/
@jsvine
jsvine / draft.md
Created August 8, 2012 14:56
Why I love Tabletop.js but don't use it in production

Tabletop.js is a fantastic, open-source JavaScript library that lets developers easily integrate data from Google Spreadsheets into their online projects. I've used it, even contributed a minor feature, and love it for prototyping. Non-programmers love being able to update a project via Google Spreadsheets' hyper-intuitive interface.

That said, I'm extraordinarily wary of using Tabletop in production. Instead, at the Wall Street Journal, we use a bit of middleware to "prune" our Google Spreadsheets-based data and then cache it on our own servers. A few brief reasons:

@GitMurf
GitMurf / filter-focus.js
Last active March 12, 2021 16:46
Roam JavaScript to focus on search box when opening a filter
document.addEventListener('click', function (evt) {
if (evt.target.className === 'bp3-icon bp3-icon-filter') {
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function removeFilters(event) {
var filteredButtons = event.target.parentElement.parentElement.parentElement.getElementsByTagName('BUTTON')
if (filteredButtons.length == 0 || filteredButtons == null) { return }
@gf3
gf3 / gist:328089
Created March 10, 2010 17:06
iTerm Colours
Black: 0, 0, 0
Red: 229, 34, 34
Green: 166, 227, 45
Yellow: 252, 149, 30
Blue: 196, 141, 255
Magenta: 250, 37, 115
Cyan: 103, 217, 240
White: 242, 242, 242
@swyxio
swyxio / readme.md
Last active January 16, 2022 10:36
svelte society day talks and resources -