Skip to content

Instantly share code, notes, and snippets.

@codebryo
codebryo / inputs.scss
Created October 21, 2014 09:47
SCSS Selector Grouping, Interpolation & Manipulation
/*
* This approach was initally inspired by Bourbons (bourbon.io) approach on packing CSS Selectors together in one
* variable so you can easily do stuff with a group of selectors.
* Since the SASS 3.4 release you don't need any extra mixins to append classes or pseudo-classes on a selector list.
*/
// Our Collection of input types we want to bind together
$_inputs-list:'input[type="email"]',
'input[type="number"]',
@mmintel
mmintel / gist:045ffce76b00b327bfc0
Last active October 12, 2020 10:34
BEM mixins in Sass 3.4
$elementSeparator: '__';
$modifierSeparator: '--';
@function containsModifier($selector) {
$selector: selectorToString($selector);
@if str-index($selector, $modifierSeparator) {
@return true;
} @else {
@return false;
}
@rileypaulsen
rileypaulsen / functions.php
Created August 19, 2014 16:08
Add Advanced Custom Fields Fields to the WP REST API
function wp_api_encode_acf($data,$post,$context){
$data['meta'] = array_merge($data['meta'],get_fields($post['ID']));
return $data;
}
if( function_exists('get_fields') ){
add_filter('json_prepare_post', 'wp_api_encode_acf', 10, 3);
}
@iamkeir
iamkeir / _font-face.scss
Created June 19, 2014 12:24
Lazy font-face generator (SCSS)
// Lazy font-face generator
// @TODO: Consider additional mixin parameter to specify which font filetypes to output, e.g. "eot, woff"
@mixin font-face($label,$font) {
@font-face {
font-family: $label;
src: url('#{$font_path}#{$font}.eot');
src: url('#{$font_path}#{$font}.eot?#iefix') format('embedded-opentype'),
url('#{$font_path}#{$font}.woff') format('woff'),
url('#{$font_path}#{$font}.ttf') format('truetype'),
url('#{$font_path}#{$font}##{$label}') format('svg');
@mixin css-edit-warning {
/*! WARNING: This CSS file was generated from a Sass file. Do NOT edit it. */
}
@jakebellacera
jakebellacera / sass_function_var.rb
Created March 14, 2014 04:52
Dynamically calls a SASS variable by a string (e.g. var("foo" + "bar") => $foobar).
# To use this in your SASS project, simply load this module into
# your environment.
module Sass::Script::Functions
# Dynamically calls a variable by a string
# e.g. var("foo" + "bar") => $foobar
def var(name)
assert_type name, :String, :name
@environment.var(name.value)
#!/bin/bash
PID_FILE=/var/run/mailcatcher.pid
NAME=mailcatcher
PROG="/usr/bin/env mailcatcher"
USER=mailcatcher
GROUP=mailcatcher
start() {
echo -n "Starting MailCatcher"
@elclanrs
elclanrs / email-confirmation.php
Last active July 26, 2024 06:10
Simple e-mail confirmation plugin for WordPress.
<?php
/**
* Plugin Name: Email Confirmation
* Description: Send an email to the user with confirmation code and store form data in database until user confirms.
* Author: Cedric Ruiz
*/
class EmailConfirmation
{
const PREFIX = 'email-confirmation-';
@livibetter
livibetter / README.md
Last active August 17, 2019 16:34
Let It Rain!