Skip to content

Instantly share code, notes, and snippets.

View croxton's full-sized avatar
💭
Up to my elbows, as usual

Mark Croxton croxton

💭
Up to my elbows, as usual
View GitHub Profile
@av01d
av01d / ColorSteps.js
Last active February 27, 2024 15:42
Javascript calculate color steps (gradient) between two colors
const ColorSteps = (() => {
/**
* Convert any color string to an [r,g,b,a] array.
* @author Arjan Haverkamp (arjan-at-avoid-dot-org)
* @param {string} color Any color. F.e.: 'red', '#f0f', '#ff00ff', 'rgb(x,y,x)', 'rgba(r,g,b,a)', 'hsl(180, 50%, 50%)'
* @returns {array} [r,g,b,a] array. Caution: returns [0,0,0,0] for invalid color.
* @see https://gist.github.com/av01d/8f068dd43447b475dec4aad0a6107288
*/
const colorValues = color => {
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@monachilada
monachilada / gatsby-config.js
Last active October 16, 2020 19:03
Sample gatsby-config.js enabling live preview in Craft CMS
const { createHttpLink } = require('apollo-link-http');
const fetch = require('node-fetch');
const store = require('store');
const sourceNodes = require('gatsby/dist/utils/source-nodes');
require('dotenv').config();
const craftGqlUrl = process.env.CRAFT_GQL_URL;
const craftGqlToken = process.env.CRAFT_GQL_TOKEN;
module.exports = {
@JacobLett
JacobLett / gist:a62a9bc4c644c31f9f99190d29abc02e
Created March 11, 2019 18:05
HubSpot Form Conversion Tracking - Google Analytics Event Script
######## Add to HEAD
<!-- Global site tag (gtag.js) - Google Ads: 802890537 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-802890537"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-ID');
@nicooprat
nicooprat / main.scss
Last active March 1, 2024 07:36
Sharing Tailwind config with SASS (Tailwind beta & Tailwind 1.0)
// Setting variables like this wouldn't be possible because SASS would
// get through this file before Tailwind does (because it's PostCSS)
$--color-primary: theme('colors.blue');
$--font-serif: theme('fontFamily.serif');
body {
color: rgba($--color-primary, .5);
font-family: $font-serif;
}
@dennisfrank
dennisfrank / Buddy-craft3-atomic-deployment-pipeline.yml
Last active July 31, 2019 18:09
Buddy.works Craft 3 Atomic Deployment Pipeline
- pipeline: "Build and deploy to [environment]"
trigger_mode: "ON_EVERY_PUSH"
ref_name: "develop"
actions:
- action: "Init: Atomic Deployment"
type: "SSH_COMMAND"
working_directory: "${remote_path}/"
login: "${user}"
host: "${host}"
port: "22"
@leevigraham
leevigraham / Generate ssl certificates with Subject Alt Names on OSX.md
Last active January 31, 2023 19:54
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

We're going to generate a key per project which includes multiple fully qualified domains. This key can be checked into the project repo as it's intended for local development but never used on production servers.

Save ssl.conf to your my_project directory.

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

@mrw
mrw / paypal_cert_test.php
Last active April 9, 2018 22:42
PHP PayPal new certificate test
<?php
/*
File prepared by Matt Weinberg, www.vectormediagroup.com and www.cartthrob.com
EXPLANATION:
In 2018, PayPal will be updating their Live/Production environment.
Many servers, especially older ones, will not be able to connect to PayPal after the settings are changed.
@rsanchez
rsanchez / gist:9549396
Last active August 29, 2015 13:57
Deep + Resource Router
<?php
use rsanchez\Deep\Deep;
use rsanchez\Deep\App\Entries;
$config['resource_router'] = array(
'json' => function($router) {
Deep::bootEloquent(ee());
$entries = Entries::channel('blog')->limit(10)->get();
@kkirsche
kkirsche / Install Composer to use MAMP's PHP.md
Last active January 30, 2024 02:30
How to install Composer globally using MAMP's PHP

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line: