Skip to content

Instantly share code, notes, and snippets.

View daviddarnes's full-sized avatar
🧱
he/him

David Darnes daviddarnes

🧱
he/him
View GitHub Profile
@bendc
bendc / randomInterval.js
Created March 9, 2017 21:55
rAF-based random interval
const randomInterval = (() => {
const random = (min, max) => Math.random() * (max - min) + min;
return (callback, min, max) => {
const time = {
start: performance.now(),
total: random(min, max)
};
const tick = now => {
if (time.total <= now - time.start) {
time.start = now;
@peterdemartini
peterdemartini / command.sh
Last active April 28, 2024 02:42
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@drabbytux
drabbytux / make-image-change-variant-sections
Created December 10, 2016 20:22
make image change variant sections
{% comment %}
Place this in your product.liquid template, at the bottom.
{% endcomment %}
{% if product.variants.size > 1 %}
<script>
var variantImages = {},
thumbnails,
variant,
variantImage,
optionValue,
@daviddarnes
daviddarnes / _config.yml
Last active April 7, 2016 14:52
Jekyll head meta
# Permalinks
permalink: pretty
# Posts
excerpt_separator: <!-- more -->
# Site info
url: "https://darn.es"
title: "David Darnes"
description: "Web Designer & Front-end Developer"
@brendandawes
brendandawes / Dawesome Design Contract.md
Last active December 22, 2022 10:13
A contract for general design services.

This contract for general design sevices is a hybrid of this one on Docracy and the AIGA one also found on Docracy. I wanted something that was simple yet covered the important bits such as payment schedule, kill fee, liability, rights etc. Change the parts in square brackets to suit. I've had this checked by a lawyer but I recommend if you decide to use it you also get it looked at by a lawyer too. Never do work without a contract in place. The majority of clients are good, decent and want to create great work with you — having a solid contract in place will strengthen that relationship and provide you with protection should things go awry.

Agreement for commission of work between [Designer Name] (Designer)

and [Client Name] (Client)

on [Date]

@jazibobs
jazibobs / instagram-image-source.html
Last active June 3, 2022 00:29
Get a link to the image file from an instagram url
<!--
Use a standard instagram url such as https://www.instagram.com/p/BB70H3bMEH-/
at the end of the link append media/?size=THE_IMAGE_SIZE_YOU_WANT
-->
<!-- Get the image file as a thumbnail -->
<img src="https://www.instagram.com/p/BB70H3bMEH-/media/?size=t" alt="Instagram Image Thumbnail">
<!-- Get the medium image file -->
<img src="https://www.instagram.com/p/BB70H3bMEH-/media/?size=m" alt="Instagram Image Medium">
@sskylar
sskylar / _config.yml
Last active December 18, 2016 02:59
Custom Posts permalink in Jekyll
collections:
posts:
title: "Articles" # replace "Articles" with name of your choice
output: true
defaults:
- scope:
path: ''
type: posts
values:
@0frasure
0frasure / cdn.html
Created October 8, 2015 21:16
Material Design Icons CDN
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
@daviddarnes
daviddarnes / command-line.md
Last active May 28, 2017 19:35
Command line setup for new machine
  1. Install oh my zsh

  2. Install brew

  3. Install with brew install rbenv

  4. Setup rbenv

  • touch ~/.zshrc
  • open ~/.zshrc
@vsouza
vsouza / .bashrc
Last active April 9, 2024 05:27
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin