Skip to content

Instantly share code, notes, and snippets.

View scottnath's full-sized avatar

Scott Nath scottnath

View GitHub Profile
@scottnath
scottnath / gist:be44614cc38f5dec4948
Created March 4, 2015 21:57
new clean git branch with --orphan
git checkout --orphan newbranch
git rm -rf .
rm -rf all-the-remaining-stuff-except-.git-directory
## should be a clean branch now
@scottnath
scottnath / designer.html
Created January 2, 2015 23:33
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>
@scottnath
scottnath / gist:93dd9d3dae02aac7dbeb
Last active August 29, 2015 14:05
Angular service to talk to Drupal
## Service Script
define(['angular'], function (angular) {
'use strict';
angular.module('atlasApp.services.Drupal', ['restangular'])
.config(function(RestangularProvider){
RestangularProvider.addResponseInterceptor(function(data, operation, what, url, response, deferred) {
var extractedData;
@scottnath
scottnath / text-shadow-mixin-HTML.html
Last active August 29, 2015 14:00
Generated by SassMeister.com.
<div class="awesome">Hammertime</div>
@scottnath
scottnath / gist:11192834
Created April 22, 2014 20:17
Git: Set up remote branches locally
for b in `git branch -r | grep -v -- '->'`; do git branch --track ${b##origin/} $b; done
@scottnath
scottnath / ose_wordpress_firewall.php
Created February 7, 2013 17:04
Path fix & bug fix for ose_wordpress_firewall.php - http://wordpress.org/support/plugin/ose-firewall
<?php
/*
Plugin Name: OSE Firewall
Plugin URI: http://wordpress.org/extend/plugins/ose-firewall/
Description: OSE Firewall - A WordPress Firewall created by Open Source Excellence. It protects your WordPress-powered blog against attacks and hacking. The email alert / notification function is disabled by default, while it can be activated and configured in <strong>Settings -> OSE Firewall</strong>. Please go to your <a href="options-general.php?page=ose_wp_firewall">OSE Firewall configuration</a> page.
Author: Open Sourcce Excellence
Version: 1.0.2
Author URI: http://www.opensource-excellence.com/
*/
define('DS', DIRECTORY_SEPARATOR);
@scottnath
scottnath / gist:4003391
Created November 2, 2012 18:30
wordpress & gravity forms: Giving Editors Access to Gravity Forms
//Giving Editors Access to Gravity Forms
function add_grav_forms(){
$role = get_role('editor');
$role->add_cap('gform_full_access');
}
add_action('admin_init','add_grav_forms');
@scottnath
scottnath / gist:3763401
Created September 21, 2012 19:27
remove all .svn folders from command line
//from the folder:
rm -rf `find . -type d -name .svn`
//to just find them all:
find . -type d -name .svn
@scottnath
scottnath / mpo2gif
Created September 21, 2012 14:46 — forked from fuba/mpo2gif
convert a .mpo file to an animation gif
#!/bin/sh
# mpo2gif
# convert a .mpo file to a animation gif.
# this idea is from http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=16275
# this script requires exiftool and imagemagick.
rjpg=/tmp/$$_r.jpg
ljpg=/tmp/$$_l.jpg
echo $1
@scottnath
scottnath / gist:3750842
Last active May 17, 2016 17:41
find text inside a file on command line
find . -name '*' -exec grep -li 'text_to_search_for' {} \;
// ignore directories (won't show ".. is a directory")
find . -name '*' -exec grep -sli 'TEXT' {} \;
// exclude directories (like `node_modules`)
find . -name '*' -not -path './node_modules/*' -exec grep -sli 'TEXT' {} \;