Skip to content

Instantly share code, notes, and snippets.

View DrewDouglass's full-sized avatar
🤠

Drew Douglass DrewDouglass

🤠
View GitHub Profile
@DrewDouglass
DrewDouglass / a.rb
Created December 11, 2015 21:34
Bootstrap animated hamburger toggle.
.navbar-toggle .icon-bar:nth-of-type(2) {
top: 1px;
}
.navbar-toggle .icon-bar:nth-of-type(3) {
top: 2px;
}
.navbar-toggle .icon-bar {
position: relative;
@DrewDouglass
DrewDouglass / bootstrap-custom-menu-breakpoint.css
Last active December 16, 2015 21:43
Snippet to change breakpoint of hamburger menu without needing to recompile SASS. Tested in bootstrap 3.
@media (max-width: !!!YOUR BREAKPOINT!!!) {
.navbar-header {
float: none;
}
.navbar-left,.navbar-right {
float: none !important;
}
.navbar-toggle {
display: block;
}
@DrewDouglass
DrewDouglass / addkeys.sh
Created December 21, 2015 19:39
Add existing keys to remote server
cat ~/.ssh/id_rsa.pub | ssh root@example.com 'cat - >> ~/.ssh/authorized_keys'
@DrewDouglass
DrewDouglass / js_border_elems.js
Created November 16, 2012 09:45
JavaSript Outline All HTML Elements
javascript:elem=document.getElementById("dev-outliner");if(elem){elem.parentNode.removeChild(elem);}else{document.body.insertAdjacentHTML('beforeEnd', '<style id="dev-outliner">*{border:1px rgba(255,0,255,0.4) solid !important;}</style>');}
@DrewDouglass
DrewDouglass / robot.php
Created November 2, 2015 14:54
Automate HTML Preview JPGs for Clients
<?php
//While <= number of files to create
$count = 1;
while($count <= 18) {
if($count === 1) {
$filename = 'index.html';
}
else {
$filename = $count.'.html';
@DrewDouglass
DrewDouglass / flicker-images.js
Last active June 9, 2016 18:45
Hide/show list of images with jQuery
//http://snook.ca/archives/javascript/simplest-jquery-slideshow
(function($){
$.fn.simplestSlideShow = function(settings){
var config = {
'timeOut': 3000,
'speed': 'normal'
};
if (settings) $.extend(config, settings);
this.each(function(){
var $elem = $(this);
@DrewDouglass
DrewDouglass / Meta Responsive Tag
Created July 21, 2016 20:31
Because I always forget the syntax.
<meta name="viewport" content="width=device-width, initial-scale=1">
@DrewDouglass
DrewDouglass / replacespace.bash
Created July 29, 2016 18:23
Bash script to replace spaces in filename with underscore.
for f in *\ *; do mv "$f" "${f// /_}"; done
@DrewDouglass
DrewDouglass / batchbw.sh
Created August 3, 2016 17:17
Batch convert JPGs to grayscale with ImageMagick
mkdir bw && for i in *.jpg; do convert $i -colorspace Gray bw/$i; done
@DrewDouglass
DrewDouglass / deploy.txt
Created August 17, 2016 15:12
Deploy - Pull from DEV to Local
fab stage:sitename pull && fab vagrant:sitename push
#To Sync
fab stage:sitename sync