This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convert string with dashes to camel case | |
* | |
* @return String | |
*/ | |
String.prototype.dashToCamelCase = function() { | |
return this.replace(/-([a-z])/g, function(g) { | |
return g[1].toUpperCase(); | |
}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------- | |
# Convert font to specified font types using ruby gem 'convert_font' | |
# | |
# @1 = Font to convert (e.g. 'fonts/ComicSansMS.ttf') | |
# @2 = Font types to convert to (e.g 'svg,woff') | |
# ----------------------------------------- | |
function convert-a-font() { | |
if [[ $(command -v convert_font) = "" ]]; then | |
echo "Ruby gem 'convert_font' must be installed." | |
if [[ $(command -v gem) = "" ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# LOAD UPLOADS FROM STAGE/PRODUCTION | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /wp-content/uploads/ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
# Rewrite local to stage | |
RewriteCond %{HTTP_HOST} ^example\.dev$ | |
RewriteRule ^wp-content/uploads/(.*)$ http://example.stage.com/wp-content/uploads/$1 [L] | |
RewriteCond %{HTTP_HOST} ^example\.dev$ | |
RewriteRule ^wp-content/uploads/(.*)$ http://example.stage.com/wp-content/uploads/$1 [L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ----------------------------------------- | |
# Return any and all paths and/or symlinks of a command | |
# | |
# @1 = command name | |
## | |
function which-all () { | |
if [[ -z "$1" ]]; then | |
echo "Script name or file path?" | |
read SCRPTNAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[[ $# -eq 1 ]] || exit 1 | |
FILEPATH="$1" | |
while true ; do | |
ls -ld "$FILEPATH" | |
[[ "$FILEPATH" != "/" ]] || exit | |
FILEPATH="$( dirname "$FILEPATH" )" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef chrome-client | |
# zsh completions for 'chrome-client' | |
# automatically generated with http://github.com/RobSis/zsh-completion-generator | |
local arguments | |
arguments=( | |
'--1[The values the kOmniboxInlineHistoryQuickProvider switch may have, as in “–omnibox-inline-history-quick-provider-allowed=1” allowed: if HistoryQuickProvider thinks it appropriate, it can inline ( == current behavior as of 2/2012).]' | |
'--action-box[Enables or disables the “action box” UI in the toolbar.]' | |
'--allow-cross-origin-auth-prompt[Allows third-party content included on a page to prompt for a HTTP basic auth username/password pair.]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Force GFORM Scripts inline next to Form Output | |
* | |
* force the script tags inline next to the form. This allows | |
* us to regex them out each time the form is rendered. | |
* | |
* see strip_inline_gform_scripts() function below | |
* which implements the required regex | |
*/ | |
function force_gform_inline_scripts() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder