Skip to content

Instantly share code, notes, and snippets.

View blackfalcon's full-sized avatar
:octocat:
Building things ...

Dale Sande blackfalcon

:octocat:
Building things ...
View GitHub Profile
<cool>
<p>Hi { message() }</p>
<script>
message() {
return 'there'
}
</script>
<style type="postcss" scoped>
@blackfalcon
blackfalcon / countCSSRules.js
Last active August 29, 2015 14:27 — forked from psebborn/countCSSRules.js
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
.bar {
background: red;
}
@blackfalcon
blackfalcon / filters.js
Created September 24, 2013 14:30 — forked from jakemmarsh/filters.js
Forked functionality - filters.js
app.filter('parseUrl', function() {
var //URLs starting with http://, https://, or ftp://
replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,
//URLs starting with "www." (without // before it, or it'd re-link the ones done above).
replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim,
//Change email addresses to mailto:: links.
replacePattern3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim;
return function(text, target, otherProp) {
angular.forEach(text.match(replacePattern1), function(url) {
@blackfalcon
blackfalcon / gcd-grid-system.scss
Last active June 6, 2016 00:45 — forked from lunelson/SassMeister-input.scss
Demo of using greatest-common-denominator function to chain extensions of classes in comparison to Stipe's grid output.
// Stipe v0.0.5.7.9
@function gcd($n, $d) {
$num: if($n < $d, $d, $n);
$denom: if($n < $d, $n, $d);
$rem: $num;
$last_rem: $num;
@while $rem != 0 {
$last_rem: $rem;
$rem: $denom % $num;
/*
Use like this (or with <dl>, <ol>, <table>)...
<ul>
<li>
<input type="checkbox" class="check-all" />
</li>
<li>
<input type="checkbox" />
</li>
@blackfalcon
blackfalcon / application.js
Created August 1, 2012 20:24 — forked from jordanmoore/RWD Screen Width Indicator (em version)
Current screen width indicator in EMs (useful for knowing when to add breakpoints when resizing browser window)
function showEms() {
var windowWidth = $(window).width();
var bodyFontSize = $('body').css('font-size');
var bodyFontSizeWithoutPx = parseInt(bodyFontSize);
var emValue = windowWidth/bodyFontSizeWithoutPx;
$('.screen-width').text(' ' + emValue + 'em');
}
// or you could do
@blackfalcon
blackfalcon / gist:2352384
Created April 10, 2012 15:58 — forked from ivanoats/gist:1823034
Setting up GIT Bash autocompletion

Run the following to create ~/.git-completion.bash:

curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash > ~/.git-completion.bash

Then add the following to your ~/.bashrc or ~/.bash_profile after PATH:

# Set the base PS1
export PS1="\t: \W$ "

Source the git bash completion file

@blackfalcon
blackfalcon / normalized.html
Created February 2, 2012 16:08 — forked from scottkellum/normalized.html
pixel normalization
<!doctype html>
<html>
<head>
<!-- Encoding -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta>