Skip to content

Instantly share code, notes, and snippets.

View daverau-optimizely's full-sized avatar

Dave Rau daverau-optimizely

  • Optimizely
  • SF
View GitHub Profile
@keyan
keyan / email_todo_authors.py
Last active January 4, 2018 18:24
A script you can run in your repo to scan for TODO messages and email the authors asking them to fix it! Can be easily adapted for other search strings.
#!/usr/bin/python
"""
This script searches the git repo looking for TODO messages, determines the
author of the line, then emails that author asking them to repair the issue.
It is intended to be run at a regular interval on a CI server or cron-job
server. By changing the `SEARCH_STRING` the script can be easily adapted to
trigger on any undesired code.
Usage:
@alishalisha
alishalisha / states.md
Last active January 6, 2021 06:59
Checking state on product design patterns

Checking the State of Your States

If applicable, make sure your design component accounts for all these states. This is basically copied from the Nine States of Design Medium article. 😛

  • Initial state: What happens before your component does anything? Maybe it’s the first time a user sees it. Maybe it’s not activated yet. Essentially, the component exists but hasn’t started.
  • Loading state: Have you accounted for when a user will be waiting for something to happen? What does that look like?
  • Empty state: Your component has initialized, but it’s empty. No data. No Items. Now may be a good time to get the user to act (“Do this thing!”), or to reward them (“Good job, everything is taken care of”).
  • One state: You have some data. On an input, this may be after the first keystroke. In a list, it might be when you have one item (or one left).
  • Some data state: This is usually what you think
@madastro
madastro / gist:9928814
Created April 2, 2014 06:17
Illustrator Save to SVG profile settings
**SVG profiles**
* SVG 1.0: all modern desktop and mobile browsers support SVG 1.1, so never choose this option.
* **SVG 1.1: You will almost always want this.**
* SVG Tiny/Basic: this is a subset of SVG intended for mobile devices. Only a handful of devices support SVG Tiny and not the full spec, so go for SVG 1.1.
Note: SVG Tiny does not reduce the file size, it's just a subset of SVG that is adequate for low processing power devices. It will discard gradients, opacity, embedded fonts and filters. Erik Dahlström says: All SVG 1.1 full viewers should be able to display all of the SVG 1.1 Tiny/Basic content (according to spec), and probably all of the SVG 1.2 Tiny content that Illustrator produces too.
**Fonts** note: if you don't have any text in your image this setting doesn't matter.
@nicoleslaw
nicoleslaw / 1_Tiny_Content_Framework.md
Last active November 16, 2025 19:39
Tiny Content Framework

Tiny Content Framework

About the project

This is a tiny content strategy framework focused on goals, messages, and branding. This is not a checklist. Use what you need and scrap the rest. Rewrite it or add to it. These topics should help you get to the bottom of things with clients and other people you work with.

Give me feedback on Twitter (@nicoleslaw) or by email (nicole@nicolefenton.com).

Contents

// Injecting JavaScript
// Basic compact
document.body.appendChild(document.createElement("script")).src="foo.js"
// Function wrapped
(function(d){d.body.appendChild(d.createElement("script")).src="foo.js"})(document)
// With "with"
with(document){body.appendChild(createElement("script")).src="foo.js"}
// Injecting CSS