Skip to content

Instantly share code, notes, and snippets.

View joeyhoer's full-sized avatar

Joey Hoer joeyhoer

View GitHub Profile
@adamgiese
adamgiese / nth-child-quantity-mixins.scss
Last active April 19, 2023 11:22
Advanced nth-child mixins
@mixin valid-quantity($quantity) {
@if type-of($quantity) != 'number' {
@error 'The "quantity" parameter must be a number!';
}
@if not(unitless($quantity)) {
@error 'The "quantity" parameter must not have a unit!';
}
@if $quantity < 0 {
@error 'The "quantity" parameter must be at least 0!';
}
@nadavspi
nadavspi / releaseNotes.js
Last active December 10, 2019 19:17
toddbc's release notes helpers
// All non-merge commits
reg = /^(.+?)(\n|$)/; ' * ' + Array.prototype.slice.call(document.querySelectorAll('.commit-message a')).map(el => el.title).filter(title => title && title.indexOf('Merge') !== 0).map(title => { var mm = title.match(reg); return mm && mm[1]; }).join("\n * ");
// Only merge commits
reg = /^[^#]+(#[0-9]+)[^\n]+\n\n((?:.|\n)+)$/; Array.prototype.slice.call(document.querySelectorAll('.commit-message a')).map(el => el.title).filter(title => title.indexOf('Merge') === 0).map(title => { var mm = title.match(reg); return mm && mm[2] + ' (' + mm[1] + ')'; }).join("\n * ");
@kjkuan
kjkuan / bashflow.sh
Created February 26, 2017 20:40
For-All Each-Do Success Fail
#!/usr/bin/env bash
#
# This is a hack that allows you to express loop and conditional processing
# of an array of items in terms of function definitions.
#
# My initial motivation came from the need to process an array of items, and
# then for those successfully processed items, do another different processing
# step, and similarly for the failed items; perform further processing/filtering
# steps for each failed/successful items.
#
@stowball
stowball / _usage.scss
Last active November 7, 2022 16:06
Recursive z-index managment
$z-indexes: (
main: (
above-inherit: (),
nested: (
low,
middle,
high
),
tooltip: ()
),
@max-mapper
max-mapper / readme.md
Last active March 16, 2023 15:18
Video stabilization using VidStab and FFMPEG (Mac OS X)

Video stabilization using VidStab and FFMPEG

Examples here use the default settings, see the VidStab readme on GitHub for more advanced instructions.

Here's an example video I made

Install ffmpeg with the vidstab plugin from homebrew

brew install ffmpeg --with-libvidstab
@freakdesign
freakdesign / imgix-theme-settings.json
Last active October 28, 2021 13:34
Snippet and Theme Settings to for converting a Shopify CDN image path into an Imgix path. Snippet allows for the passing of Imgix filters.
{
"name": "Imgix",
"settings": [
{
"type": "paragraph",
"content": "For more info on these theme settings refer to the original [blog post](http:\/\/freakdesign.com.au\/blogs\/news\/91099207)"
},
{
"type": "checkbox",
"id": "enableImgix",
@sumdog
sumdog / stripfootnotes.rb
Created November 7, 2015 09:05
Jekyll plug-in for stripping footnotes from kramdown encoded text
require 'nokogiri'
module Jekyll
module StripFootnotesFilter
def strip_footnotes(raw)
doc = Nokogiri::HTML.fragment(raw.encode('UTF-8', :invalid => :replace, :undef => :replace, :replace => ''))
for block in ['div', 'sup', 'a'] do
doc.css(block).each do |ele|
@mathebox
mathebox / color_conversion.py
Created April 12, 2015 16:47
Python methods to convert colors between RGB, HSV and HSL
import math
def rgb_to_hsv(r, g, b):
r = float(r)
g = float(g)
b = float(b)
high = max(r, g, b)
low = min(r, g, b)
h, s, v = high, high, high
@mattak
mattak / slackpost.sh
Last active September 3, 2021 08:05
post message to slack
#!bash -e
TOKEN= # slack token is generate from: https://api.slack.com/web
CHANNEL= # name of channels or group
MESSAGE= # message
NICK= # bot name
IS_PRIVATE= # 1 or 0
if [ $IS_PRIVATE -eq 1 ]; then
API_TYPE=groups
@bobbygrace
bobbygrace / trello-css-guide.md
Last active April 22, 2024 10:15
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?