Skip to content

Instantly share code, notes, and snippets.

View grahamlicence's full-sized avatar

Graham Licence grahamlicence

  • 101 Ways
  • London
View GitHub Profile
@grahamlicence
grahamlicence / disqus.html
Created March 17, 2016 11:14
Load Disqus comments on click
<button class="disqus-button">View comments</button>
<div id="disqus_thread"></div>
<script async="true">
var disqus_config = function () {
this.page.url = YOUR_PAGE_URL;
this.page.identifier = YOUR_PAGE_IDENTIFIER;
},
button = document.getElementsByClassName('disqus-button')[0],
loadDisqus = function(e) {
e.preventDefault();
Sublime Text Packages
A few recommended packages:
“DocBlockr"
Allows you to easily write comments in the format:
/**
*
*/
“EditorConfig"
{
"bitwise": false,
"browser": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"es3": true,
"esnext": true,
"expr": true,
"forin": true,
{
/*
based on google style guide preset:
https://raw.githubusercontent.com/jscs-dev/node-jscs/master/presets/google.json
modifications for mini digital:
- "validateIndentation" set to 4, rather than the google default of 2
- "maximumLineLength" removed, rather than the google default of 80
- "disallowSpacesInAnonymousFunctionExpression.beforeOpeningCurlyBrace" replaced with "requireSpacesInAnonymousFunctionExpression.beforeOpeningCurlyBrace"
- because this isn't explicitly specified in the google style guide,
// --------------------------------------------------
// Flexbox LESS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
// flex or inline-flex
.flex-display(@display: flex) {
display: ~"-webkit-@{display}";
display: ~"-moz-@{display}";
@grahamlicence
grahamlicence / index.html
Last active August 29, 2015 14:03
GitHub banner CSS SVG
<p class="footnote">Experiment by Graham licence. <a href="https://gist.github.com/grahamlicence/a4a5b2d21e4dfa2a9792" class="github">Fork me on GitHub</a></p>
@grahamlicence
grahamlicence / animationend.js
Created June 23, 2014 14:19
Listening for animationend event cross browser (vanilla JavaScript)
var btn = document.querySelectorAll('button')[0],
animatedElement = document.querySelectorAll('.animated-element')[0],
animationEndEvent = null; // use this to check for support and trigger fallback
// feature detect which vendor prefix is used
(function getAnimationEventName () {
var testEl = document.createElement('div'),
transEndEventNames = {
'WebkitAnimation': 'webkitAnimationEnd',
'MozAnimation': 'animationend',
@grahamlicence
grahamlicence / steps.md
Created April 3, 2014 11:22
Steps indicator styles
.steps {
    margin-bottom: 0.5em;
    margin-top: 1em;
    border-top: solid 1px $drkyellow;
    text-align: center;
    ul {
        list-style: none;
        padding: 0.5em;
        margin: -1.5em 0 0;
@grahamlicence
grahamlicence / setup.md
Last active November 6, 2015 14:12
Machine setup

##Mac show hidden files

defaults write com.apple.finder AppleShowAllFiles YES

change git text editor

git config --global core.editor "nano"
{
"font_size": 9,
"ignored_packages":
[
"Vintage"
],
"translate_tabs_to_spaces": true,
"tab_size": 4
}