Skip to content

Instantly share code, notes, and snippets.

View craigmdennis's full-sized avatar
🚀

Craig Dennis craigmdennis

🚀
View GitHub Profile
@craigmdennis
craigmdennis / buttons.jade
Created October 21, 2014 03:01
Jade mixins for common Bootstrap buttons with icons
mixin btn-like(num)
a(href="#" title="Like").btn.btn-default #{num}
span.sr-only Like
if num
i.icon-like.icon-after
else
i.icon-like
mixin btn-liked(num)
a(href="#" title="Unlike").btn.btn-default.active #{num}
@craigmdennis
craigmdennis / network-colors.scss
Created October 20, 2014 23:11
Iterate through a SASS map and out put different results based on the variable type
// Social Network Colours
$network-colors: (
twitter: #00ACED,
youtube: #CD201F,
pinterest: #CB2027,
github: #333333,
dribbble: #EA4C88,
instagram: #517FA4
);
@craigmdennis
craigmdennis / deploy.rb
Created September 17, 2014 19:02
Wordpress multi-environment setup and Capistrano deployment hook
# Namespaced to reduce conflict
namespace :mysite do
desc 'Make a production file'
task :production do
on roles(:app), in: :groups do
execute "touch #{release_path}/env_production"
end
end
@craigmdennis
craigmdennis / ssh.md
Last active August 29, 2015 14:06
Setting up capistrano and ssh access on new server

Setting up capistrano and ssh access on new server

When getting an error 'git-ssh.sh': Permission denied add set :tmp_dir, "/home/{username}/tmp" to the deploy.rb file.

1. Copy local ssh public key to clipboard

'pbcopy < ~/.ssh/id_rsa.pub'

2. Add clpboard contents to authorized_hosts

vim authorized_hosts

@craigmdennis
craigmdennis / _twitter.jade
Last active August 29, 2015 14:06
Twitter Card <meta> in jade
meta(name="twitter:card", content="summary")
meta(name="twitter:site", content="@craigmdennis")
meta(name="twitter:title", content="{{title}}")
meta(name="twitter:description", content="{{description}}")
meta(name="twitter:img", content="http://craigmdennis.com/logo.png")
meta(name="twitter:url", content="{{url}}")
@craigmdennis
craigmdennis / _flourish.scss
Last active August 29, 2015 14:06
Scoped Typography
.context__flourish {
ul {
list-style: disc;
margin-left: 1.5em; /* Left and right margins are allowed here */
}
}
@craigmdennis
craigmdennis / _debug.scss
Last active March 21, 2023 02:31
Sass mixins for vertical rhythm and scoped typography with pixel fallback for IE.
$debug-rhythm: false;
@craigmdennis
craigmdennis / _debug-breakpoint.scss
Last active August 29, 2015 14:06
A simple way to help identify which breakpoint you're in when using $variables as media query values.
$debug-breakpoint: true;
$bp1: 'min-width: 20em'; // 320px
$bp2: 'min-width: 30em'; // 480px
$bp3: 'min-width: 37.5em'; // 600px
$bp4: 'min-width: 48em'; // 768px
$bp5: 'min-width: 56.25em'; // 900px
$bp6: 'min-width: 68.75em'; // 1100px
$bp7: 'min-width: 81.25em'; // 1300px
@craigmdennis
craigmdennis / reset.scss
Last active September 30, 2015 20:56
Reset
// ===================================================
// Reset
// ===================================================
// Adapted from Normalize
// https://github.com/necolas/normalize.css/
// and Eric Meyer's Reset
// http://meyerweb.com/eric/tools/css/reset/
// ===================================================
// It's safe to use box-sizing
@craigmdennis
craigmdennis / remove.php
Last active August 29, 2015 14:06
Remove menus for specific users in Wordpress
<?php
add_action( 'admin_menu', 'remove_menus' );
function remove_menus() {
global $menu;
global $submenu;
// echo '<pre>';
// print_r($menu);