Skip to content

Instantly share code, notes, and snippets.

View adamjohnson's full-sized avatar

Adam Johnson adamjohnson

View GitHub Profile
@adamjohnson
adamjohnson / default-file-type-installation.md
Last active August 29, 2015 14:05
DefaultFileType for Sublime Text - How to get it up and running

How to get the DefaultFileType pacakge for Sublime Text working

  1. Install the package via Package Control (it works with ST3, don't worry).
  2. Create a new file called default_file_type.sublime-settings and paste the following:
{
  "default_new_file_syntax" : "Packages/HTML/HTML.tmLanguage",
   "use_current_file_syntax" : false
}
@adamjohnson
adamjohnson / _breadcrumbs.css
Last active December 19, 2015 19:58
Breadcrumbs in an unordered list for SlateCMS: http://slatecms.wvu.edu
#breadcrumbs li { display: inline; list-style-type: none; margin-left: 0; }
#breadcrumbs li:before { content: "\00BB"; padding-right: 3px; }
#breadcrumbs li:first-child:before { content: ""; padding-right: 0; }
@adamjohnson
adamjohnson / publickey-git-error.markdown
Last active May 10, 2024 10:00
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
@adamjohnson
adamjohnson / retina-images.scss
Last active December 16, 2015 08:29
Painless retina images in Sass. Requires Compass.
// Painless Retina Images:
// =======================
// https://gist.github.com/adamjohnson/5406454
// http://blog.andrewckor.com/post/43347215341/retina-background-images-sass-mixin
// Requires Compass
// Suffix retina imagery with "@2x" & put in the same directory as normal assets (or specifiy a different directory in the @include)
@mixin bg-with-retina( $path, $img, $filetype, $size ) {
background-image: image-url( $path + $img + '.' + $filetype );
@include background-size( $size );
@adamjohnson
adamjohnson / at-include.sublime-snippet
Last active July 30, 2018 15:53
Create a tab trigger / shortcut for Sublime Text to spit out @include when you type 'in' then hit tab. Go to Tools > New Snippet. Save this in Packages > User.
<snippet>
<content><![CDATA[
@include
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>in</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.scss</scope> -->
</snippet>
@adamjohnson
adamjohnson / _buttons.scss
Last active December 14, 2015 21:59
CSS3 Stylish buttons from Dira.ro, converted to SCSS
// ---
// Compass (v0.13.alpha.4)
// Sass (v3.2.7)
// ---
// Make making buttons easier
// https://css3-buttons.heroku.com/
// https://github.com/dira/CSS3-stylish-buttons
// This file has been converted to SCSS & requires Compass
@adamjohnson
adamjohnson / Preferences.sublime-settings
Last active December 11, 2020 17:27
My Sublime Text User Preferences
{
"always_show_minimap_viewport": true,
"binary_file_patterns":
[
"node_modules/**",
"bower_components/**"
],
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
"fade_fold_buttons": false,
@adamjohnson
adamjohnson / controller.php
Created December 6, 2012 06:33
Overriding the Concrete5 Image block to not print out width & height attributes
<?php
defined('C5_EXECUTE') or die("Access Denied.");
/*
* How to make overrides/extend controllers in Concrete v5.6+
* 1. Create a new file & put your opening & closing PHP tags
* 2. Add line 2 above (execute or die!)
* 3. Go to (root)/concrete/blocks/block-you-want-to-override/file-you-want-to-override.php
* 4. You'll see something like 'class somethingBlah extends somethingElse_blah'. Copy that with the opening & closing brackets
* 5. Now go to (root)/concrete/core/controllers/blocks/file-you-want-to-change.php
* 6. Open said file and look at the functions inside of it. Copy from 'function... { stuff... }' --being sure to include the closing bracket
@adamjohnson
adamjohnson / index.html
Created October 3, 2012 19:48
Working with Attributes in Concrete5, download this code and paste into a .html document
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Working with Attributes in Concrete5</title>
<style>
pre { border: 1px solid black; padding:10px; }
</style>
</head>
<body>
@adamjohnson
adamjohnson / blueprint-screen-mobile.css
Created August 28, 2012 04:39
Make Blueprint CSS Mobile Friendly
/* -------- BEGIN MOBILE STYLES -------- */
/* By Adam Johnson - 8-28-12 - @adamj_design */
/* Paste these either at the end of your custom styles.css, or at the end of screen.css */
/*--- fluid images and objects ---*/
img, object, embed {max-width: 100%;}
/* Let's reset blueprint's grid. Inherits styles from: Default Layout. */
@media only screen and (max-width: 959px) {
.container {width:95%; margin: 0 10px;}