Skip to content

Instantly share code, notes, and snippets.

Dan Matthew danielmatthew

View GitHub Profile
@danielmatthew
danielmatthew / 6.txt
Last active Jan 28, 2018
Global Packages
View 6.txt
/Users/dm/.nvm/versions/node/v6.9.5/lib
├── @storybook/cli@3.3.10
├── a11y@0.5.0
├── axe-cli@1.3.0
├── bower@1.8.2
├── create-react-app@1.0.0
├── eslint@4.12.1
├── firebase-tools@3.16.0
├── gatsby@1.9.128
├── lighthouse@2.6.0
@danielmatthew
danielmatthew / .travis.yml
Last active Dec 9, 2017
danmatthew.co.uk Travis config
View .travis.yml
branches:
only:
- master
language: ruby
rvm: 2.2
sudo: required
dist: trusty
cache:
- npm
install:
@danielmatthew
danielmatthew / console.js
Created Jun 28, 2016
SitePoint console.log example
View console.js
if (console && console.log && window && window.localStorage && !window.localStorage["hide-watermark"]) {
console.log("%c", "font-size:34px; line-height:1.4em;");
var u = "color:#f9a141;font-weight:bold;"
, a = "color:#258aaf;font-weight:bold;"
, f = "font-size:34px; font-weight:200; letter-spacing:0.02em; line-height:1.4em; font-family:helvetica,arial; color:rgba(0,0,25,0.75);"
, l = "font-size:21px; font-weight:200; letter-spacing:0.2em; line-height:1.4em; font-family:helvetica,arial; color:rgba(0,0,25,0.5);";
console.log(" %cXX\n %cXXXXXX\n %cXXXXXXXXXX\n %cXXXXXXXXXXXX\n %cXXXXXXXXXXXX %cXX\n %cXXXXXXXXXXXX %cXXXXXX\n%cXXXXXXXXXXXX %cXXXXXXXXXX\n %cXXXXXXXXXXXX %cXXXXXXXXXXXX\n %cXXXXXXXXXXXX %cXXXXXXXXXXXX\n %cXXXXXXXXXXXX %cXXXXXXXXXXXX\n %cXXXXXXXXXX %cXXXXXXXXXXXX\n %cXXXXXX %cXXXXXXXXXXXX\n %cXX %cXXXXXXXXXXXX\n %cXXXXXXXX
@danielmatthew
danielmatthew / example.scss
Created Jun 13, 2016
!important use case
View example.scss
.input-group-btn > .btn {
background-color: $white;
border-color: $white;
border-left-color: $well-bg !important;
&:hover {
background-color: $gray-superlight;
border-color: $gray-superlight;
}
View Preferences.sublime-settings
{
"bold_folder_labels": true,
"caret_extra_bottom": 2,
"caret_extra_top": 2,
"caret_extra_width": 3,
"caret_style": "phase",
"color_scheme": "Packages/Theme - Cobalt2/cobalt2.tmTheme",
"create_window_at_startup": false,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
View gist:730c60ac76a55fcbc66c
#[remote "origin"]
push = +refs/heads/master:refs/heads/gh-pages
push = +refs/heads/master:refs/heads/master
@danielmatthew
danielmatthew / .csscomb.json
Last active Aug 29, 2015
Preferred CSScomb settings
View .csscomb.json
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "double",
View sass-mq
$medium-screen: 30em;
$big-screen: 50em;
@mixin medium {
@media (min-width: #{$medium-screen}) and (max-width: #{$big-screen} - 1px) {
@content;
}
}
@mixin large {
@danielmatthew
danielmatthew / gist:9205095
Created Feb 25, 2014
Reduces element margin on scroll. Useful with fixed element.
View gist:9205095
$(window).scroll(function()
{
$("#phone").css("margin-top",Math.max(0,970-$(this).scrollTop()));
});
}
@danielmatthew
danielmatthew / linked-list
Created Jan 22, 2014
The essence of a linked list in JavaScript
View linked-list
// A single node
var node1 = {
data: null,
next: null
};
// Add data to node
node1.data = 12;
// Create another node
You can’t perform that action at this time.