Operate on all project files easily with global search/replace
When running 'find and replace' in entire project
app/webroot/js/!(build)/**/*.js
#!/bin/bash | |
echo "Arguments:" | |
echo $@ | |
echo "---" | |
FILES_PATTERN='(\..+)?$' | |
FORBIDDEN='(@?NOCOMMIT|@?COMMITFAIL)' | |
if ( git diff --cached --name-only | grep -E $FILES_PATTERN | xargs grep -E --with-filename -n $FORBIDDEN ); then | |
echo "ERROR: @COMMITFAIL or @NOCOMMIT found. Exiting to save you from yourself." |
<input type="text" class="js-format-currency" value="12345.00" /> |
PLATFORM=$(uname) | |
ISLINUX=0 | |
WORKING_DIR=$(pwd) | |
CONFIG_DIR=$(cd ../config && pwd) | |
if [ $PLATFORM = 'Linux' ]; then | |
ISLINUX=1 | |
OS_CODENAME=$(lsb_release -cs) | |
else | |
OS_CODENAME="trusty" |
#!/usr/bin/env ruby | |
require 'colorize' | |
require 'open3' | |
require 'benchmark' | |
require 'optparse' | |
class TestRunner | |
attr_accessor :converge_enabled, :verify_enabled |
# URI of the local (caching) HTTP proxy | |
LOCAL_HTTP_PROXY = 'http://192.168.33.200:8123' | |
# Configures vagrant-cachier and vagrant-proxyconf. | |
# Should be called only on "local machine" providers. | |
def configure_caching(config) | |
if Vagrant.has_plugin?('vagrant-cachier') | |
config.cache.enable_nfs = true | |
config.cache.enable :gem | |
config.cache.enable :npm |
{ | |
"TODO": "TODO[\\s]*?:[\\s]*(?P<todo>.*)$", | |
"NOTE": "NOTE[\\s]*?:[\\s]*(?P<note>.*)$", | |
"FIXME": "FIX ?ME[\\s]*?:[\\s]*(?P<fixme>.*)$", | |
"CHANGED": "CHANGED[\\s]*?:[\\s]*(?P<changed>.*)$", | |
"CONSOLE": "console\\.(log|warn|error|notice)\\((?P<console>.*)\\);?$" | |
} |
$ -> | |
is_chrome = navigator.userAgent.indexOf('Chrome') > -1 | |
is_explorer = navigator.userAgent.indexOf('MSIE') > -1 | |
is_firefox = navigator.userAgent.indexOf('Firefox') > -1 | |
is_safari = navigator.userAgent.indexOf("Safari") > -1 | |
is_opera = navigator.userAgent.indexOf("Presto") > -1 | |
is_mac = (navigator.userAgent.indexOf('Mac OS') != -1) | |
is_windows = !is_mac | |
if is_chrome && is_safari |
#!/bin/bash | |
#set -x | |
# Shows you the largest objects in your repo's pack file. | |
# Written for osx. | |
# | |
# @see https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
# @author Antony Stubbs | |
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output |