Skip to content

Instantly share code, notes, and snippets.

A17.Behaviors.pinboard = function(container){
var colCount = container.getAttribute("data-col-count");
var colWidth = 0;
var margin = 0;
var windowWidth = 0;
var cols;
function setupBlocks() {
margin = (A17.media_query_in_use === "large") ? 40 : 30;
@13twelve
13twelve / humans.txt
Created February 24, 2016 12:27
humans.txt A17 example
/* SITE BY */
Name: AREA 17, http://www.area17.com/
/* A17 TEAM */
Role: Producer
Name: Angela Bliumis
Site: http://www.area17.com/people/angela-bliumis
Role: Designer
Name: Martin Rettenbacher
@13twelve
13twelve / hipchat.php
Created March 23, 2016 16:20
A17 timezones Hip Chat integration
<?php
date_default_timezone_set("UTC");
$time_str = "";
//$format = 'h:i a j M';
$format = 'h:i a';
$datetime = new DateTime(date("Y-m-d H:i:s"),new DateTimeZone('UTC'));
$locations = array();
array_push($locations, array("name" => "Paris", "timezone" => "Europe/Paris", "emoji" => "🇫🇷"));
@13twelve
13twelve / btn.scss
Created April 27, 2016 18:01
Mike SCSS grids
/* buttons should always be 4 columns wide, except on small when 100% */
.btn {
width: col-span(4,large);
@include breakpoint(medium) {
width: col-span(4,medium);
}
@include breakpoint(small) {
width: col-span(6,small); // equivilant to width: 100%;
}
@13twelve
13twelve / .jshintrc
Created May 11, 2016 14:30
.jshintrc
{
// Predefined globals whom JSHint will ignore
"browser": true, // Standard browser globals e.g. 'window', 'document'
"globals": {
"min$": false,
"$": false,
"console":true,
"A17":true
},
// Development
@13twelve
13twelve / aliases.txt
Created August 26, 2016 15:41
Terminal aliases
alias hosts='subl /private/etc/hosts'
alias bash_profile="subl ~/.bash_profile"
alias gitconfig="subl ~/.gitconfig"
alias httpd.conf="subl /private/etc/apache2/httpd.conf"
alias phpini="subl /usr/local/etc/php/5.5/php.ini"
alias pingg='ping www.google.com'
alias ls="ls -G"
alias fuck="say fuck sake"
alias fans='top -o CPU -stats PID,COMMAND,CPU'
@13twelve
13twelve / head.js
Created October 26, 2016 16:29
head.js - to be inlined in the head of a document
// set up a master object
var A17 = window.A17 || {},
d = document,
de = d.documentElement,
w = window;
// test for HTML5 vs HTML4 support, cutting the mustard. Caution: IE9 will pass this..
A17.browserSpec = (typeof d.querySelectorAll && 'addEventListener' in w && A17.svgSupport) ? 'html5' : 'html4 ';
// test for SVG support
A17.svgSupport = d.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1');
// test for touch support. Caution: this is dangerous: https://hacks.mozilla.org/2013/04/detecting-touch-its-the-why-not-the-how/
@13twelve
13twelve / wyss_responsive_post_images.php
Created December 8, 2016 15:05
Wyss responsive post images
function wyss_responsive_post_images( $content ){
// unwrap images of links, except the one in the video embed
$content = preg_replace('/(?<!\<\/iframe>)<a.*?>(<img.*?>)<\/a>/', '$1', $content);
// wrap imgs in figures (if not in figures)
$content = preg_replace('/(\s|^)(<img.*?( class=[\'\"].*?[\"\']).*?>)(\s|$)/', '<figure$3>$2</figure>', $content);
// remove style from figure
$content = preg_replace('/(figure[^>]*) style=(\"|\')+[a-zA-Z0-9:;\.\s\(\)\-\,\#\_]*(\"|\')/', '$1', $content);
// remove ID from figures
$content = preg_replace('/(figure[^>]*) id=(\"|\')+[a-zA-Z0-9:;\.\s\(\)\-\,\#\_]*(\"|\')/', '$1', $content);
// unwrap <div class="entry-content-asset">
.calendar {
@include font__ui;
}
.calendar__title {
display: block;
padding: 19px 45px;
font-weight: normal;
text-align: center;
}
@13twelve
13twelve / getUnfuddleUsers.js
Created March 14, 2018 15:23
Make Unfuddle user list into a CSV
javascript:(function() {
var people = Unfuddle.Globals.people;
var str = 'Is Admin; Name; Email; Username; Projects\n';
function extractUserInfo(person){
if (!person.is_removed && person._displayName) {
str += person.is_administrator + '; ';
str += person._displayName + '; ';
str += person.email + '; ';
str += person.username + '; ';