Skip to content

Instantly share code, notes, and snippets.

View fieldoffice's full-sized avatar
🚲
Out cycling

Andy Field fieldoffice

🚲
Out cycling
View GitHub Profile
@robweychert
robweychert / typographic-scale-generator.md
Last active October 26, 2021 13:21
Sass typographic scale generator

Sass typographic scale generator

Generate a typographic scale of CSS variables with any interval (fixed or proportional) and any number of sizes. Just edit $interval, $body-text, $scale-min, and $scale-max:

:root {
  $interval: 1.5;    // Unitless for proportional, unit for fixed
  $body-text: 1rem;  // Must have a unit
  $scale-min: -2;    // Unitless negative integer
  $scale-max: 2;     // Unitless positive integer
#!/usr/bin/env bash
echo "Starting bootstrapping"
# Check for Homebrew, install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
@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]

@chrtze
chrtze / chart.js
Created November 23, 2015 20:00
Line Chart Example
var Chart = (function(window,d3) {
var svg, data, x, y, xAxis, yAxis, dim, chartWrapper, line, path, margin = {}, width, height, locator;
var breakPoint = 768;
d3.csv('data.csv', init); //load data, then initialize chart
//called once the data is loaded
function init(csv) {
@WPprodigy
WPprodigy / tracking-code-at-checkout.php
Last active August 19, 2020 20:00
Add analytics tracking to the WooCommerce order received / thank-you page
/**
* Add Tracking Code to the Order Recieved Page
*/
function wc_ninja_checkout_analytics( $order_id ) {
$order = new WC_Order( $order_id );
$currency = $order->get_order_currency();
$total = $order->get_total();
$date = $order->order_date;
?>
<!-- Paste Tracking Code Under Here -->
// Photoshop Script to Create iPhone Icons from iTunesArtwork // // WARNING!!! In the rare case that there are name collisions, this script will // overwrite (delete perminently) files in the same folder in which the selected // iTunesArtwork file is located. Therefore, to be safe, before running the // script, it's best to make sure the selected iTuensArtwork file is the only // file in its containing folder. // // Copyright (c) 2010 Matt Di Pasquale // Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and
@pbojinov
pbojinov / README.md
Last active June 24, 2024 05:39
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@mommaroodles
mommaroodles / functions.php
Created February 1, 2014 23:49
Woocommerce: Add Terms and Conditions in Checkout Page
<?php
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '
<div id="terms_conditions">
<h3>'.__('Terms and Conditions: ').'<a href="link-to-url">view here</a></h3>
'; woocommerce_form_field( 'terms_conditions', array( 'type' =>; 'checkbox', 'class' =>;
array('input-checkbox'), 'label' =>; __('I have read and agreed.'), 'required' => true, ), $checkout->;get_value( 'terms_conditions' )); echo '
</div>