Skip to content

Instantly share code, notes, and snippets.

View colourgarden's full-sized avatar

Tom Hare colourgarden

View GitHub Profile
#!/bin/bash
# Install xcode CLI
echo "Installing xcode-stuff"
xcode-select --install
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
@threepointone
threepointone / for-snook.md
Last active August 26, 2023 15:43
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.

@KreigD
KreigD / flickity-carousel.php
Created June 14, 2018 22:28
Flickity WordPress Carousel
@dannygsmith
dannygsmith / valet-plus-destroy
Last active July 18, 2023 09:07
Remove valet-plus - reboot required
#!/usr/bin/env bash
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
VP_CYAN='\033[01;36m'
VP_WHITE='\033[01;37m'
<?php
/**
* Regenerate missing image sizes only.
*
* Note: Untested code
*/
function regenerate($image_size = '', $attachment_id = []) {
global $wpdb;
@Vestride
Vestride / encoding-video.md
Last active June 5, 2024 14:38
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@fabianmarz
fabianmarz / Preferences.sublime-settings
Last active June 5, 2017 12:42
Sublime Text config
{
"always_show_minimap_viewport": true,
"animation_enabled": false,
"auto_complete_selector": "source, text",
"caret_extra_bottom": 3,
"caret_extra_top": 3,
"caret_extra_width": 2,
"color_scheme": "Packages/ayu/ayu-mirage.tmTheme",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
@mattbrailsford
mattbrailsford / RobotsTxtCheck.cs
Created October 29, 2011 16:42
An example uGoLive check
namespace Our.Umbraco.uGoLive.Checks
{
[Check("8088E981-174C-4ABA-9867-AF219B4E0D9E", "Robots.txt", "Create a robots.txt file to block access to system folders", "SEO")]
public class RobotsTxtCheck : AbstractCheck
{
public override bool CanRectify
{
get { return false; }
}
@makeusabrew
makeusabrew / 1) uglify.js
Created October 25, 2011 11:54
Watch a specified directory's JavaScript files and recompile a specified output file if any changes are detected
/**
* Sample usage - note that the trailing slash on the watch directory is important!
*
* node uglify.js /path/to/my/src/directory/ /path/to/my/output/file.js
*/
var jsp = require('uglify-js').parser,
pro = require('uglify-js').uglify,
fs = require('fs');