Skip to content

Instantly share code, notes, and snippets.

View makenosound's full-sized avatar

Max Wheeler makenosound

View GitHub Profile
@makenosound
makenosound / grid.scss
Created March 4, 2013 04:31
SASS cascades aren’t quite as smart as I wish they were
// 8-column grid where each columns is 12.5%
%grid {
display: inline;
float: left;
clear: none;
}
%grid-2 {
@extend %grid;
@makenosound
makenosound / flexible-grid.scss
Last active December 14, 2015 11:38
A flexible grid structure using SASS and placeholder classes
// Configurables
$flexibleGridColumns: 24 !default;
$flexibleGridColumnWidth: 30px !default;
$flexibleGridGutterWidth: 18px !default;
// Full width of a row
$flexibleGridRowWidth: ($flexibleGridColumns * $flexibleGridColumnWidth) + ($flexibleGridGutterWidth * ($flexibleGridColumns - 1));
// The width of a column
$flexibleGridGridWidth: percentage($flexibleGridColumnWidth / $flexibleGridRowWidth);
@makenosound
makenosound / spacing-class.css.scss
Created May 3, 2013 02:03
Modified version of the `spacing-classes` pattern from Stitch. Allows you to specify additional units for output.
// Generate inline class names for your elements
//
// <div class="actions inset-vert-small-large">
// <button type="submit">Totes click me!</button>
// </div>
//
// Padding
// ---------------
// pad-{item} : pad-small (padding: 10px)
// pad-vert-{item}-{item + 1} : pad-vert-small-large (padding: 10px 0 40px 0)
@makenosound
makenosound / convert.pl
Created January 23, 2016 01:46
Use ffpmeg to convert h.265 to h.265
#!/usr/bin/perl
use strict;
use warnings;
open DIR, "ls -1 |";
while (<DIR>)
{
chomp;
next if ( -d "$_"); # skip directories
@makenosound
makenosound / async.rb
Created January 18, 2019 04:06 — forked from paul/async.rb
Implementations of useful step adapters for dry-transaction
# frozen_string_literal: true
module Tesseract
module Transaction
module Steps
# Executes the step in a background job. Argument is either an ActiveJob
# or another Transaction (or anything that implements `#perform_later`.
#
# If the provided transaction implements a `validate` step, then that
# validator will be called on the input before the job is enqueued. This
tinymce.PluginManager.add('smartquotes', function(editor) {
function convert(e) {
rootNodes = editor.dom.select("body > *");
for (var i = 0; i < rootNodes.length; i++) {
var el = rootNodes[i];
var contentEditable = editor.dom.getAttrib(el, "contenteditable");
if (contentEditable !== "false") {
convertBlock(el);