Skip to content

Instantly share code, notes, and snippets.

View scottboms's full-sized avatar
👀

Scott Boms scottboms

👀
View GitHub Profile
@adamyeats-zz
adamyeats-zz / script.js
Last active April 7, 2017 21:18
Typekit Hack
/*
This small hack loads fonts from the Typekit webfontloader (https://github.com/typekit/webfontloader)
contextually, effectively "patching" in a new font if a media query is fired.
You need to have 2 seperate kits on Typekit, one for your main fonts, and another for the fonts you want
when the media query is fired.
Improvements or suggestions welcome!
{exp:query sql="
SELECT md.entry_id, cd.field_id_56, md.col_id_48
FROM exp_matrix_data AS md
LEFT JOIN exp_playa_relationships AS pr
ON md.entry_id = pr.parent_entry_id
LEFT JOIN exp_channel_data AS cd
ON pr.child_entry_id = cd.entry_id
WHERE md.field_id = 123
AND md.row_order = 1
GROUP BY md.entry_id
@objectivehtml
objectivehtml / gist:3761912
Created September 21, 2012 14:48
Manipulate the no_results tag
// Add this to your module tag
if($no_results_prefix = $this->EE->TMPL->fetch_param('no_results_prefix'))
{
if(preg_match('/\\'.LD.'if '.$no_results_prefix.'no_results\\'.RD.'.*\\'.LD.'\\/if\\'.RD.'/us', $this->EE->TMPL->tagdata, $matches))
{
$this->EE->TMPL->no_results = $this->EE->TMPL->parse_variables_row($matches[0], array(
$no_results_prefix.'no_results' => 1
));
}
@KuraFire
KuraFire / rgbaa.scss
Created September 13, 2012 21:18
More dynamic, oldIE-compatible SCSS function for rgba
@function rgbaa($args...) {
// rgbaa(#FFF, .5)
@if length($args) == 2 {
$hex: nth($args, 1);
$alpha: nth($args, 2);
@if $oldIE == 1 {
@return rgb(red($hex), green($hex), blue($hex));
} @else {
@return rgba(red($hex), green($hex), blue($hex), $alpha);
@timkelty
timkelty / default.html
Created August 28, 2012 19:12
Using Stash for parsing "needles" out of content fields (similar to techniques using Copee Pastee/LG Replace)
{!-- embed page template --}
{embed="site/_page"
hide_site_title="{embed:hide_site_title}"
body_class="p-default"
}
{!-- get channel data --}
{exp:channel:entries
limit="1"
entry_id="{embed:entry_id}"
@marcedwards
marcedwards / high-dpi-media.css
Last active March 2, 2025 20:24
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@simonscheiber
simonscheiber / sitemap.php
Created August 15, 2012 22:07
Kirby sitemap generator excluding invisible folders
<?php
$ignore = array('sitemap', 'error');
// send the right header
header('Content-type: text/xml; charset="utf-8"');
// echo the doctype
echo '<?xml version="1.0" encoding="utf-8"?>';
@simonscheiber
simonscheiber / figure.php
Created August 15, 2012 16:51 — forked from bastianallgeier/figure.php
Kirby figure extension with class element.
<?php
class kirbytextExtended extends kirbytext {
function __construct($text, $markdown=true) {
parent::__construct($text, $markdown);
// define custom tags
$this->addTags('figure');
@john-henry
john-henry / gist:3179683
Created July 26, 2012 01:07
Infinite Scroll & Masonry in ExpressionEngine
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="author" content="">
@jimmynotjim
jimmynotjim / more-mute-regex.md
Created July 19, 2012 14:37 — forked from imathis/tweetbot-mute-regex.md
Tweetbot can use regular expressions to mute tweets in your timeline and mentions.

##Simply annoying Tweets

Annoyingly extended words (4+ of the same letter in a phrase): OOOOHHHHMMMMYYYYGGGGOOOODDDD

([a-z])/1{4}

Tweet w/ just a single hashtag: #omgthissucks

^ *#[^ ]+$