Skip to content

Instantly share code, notes, and snippets.

@Zoramite
Zoramite / maintenance.sh
Created March 14, 2012 21:25
Git Maintenance Commands
# Verifies the connectivity and validity of the objects in the database
git fsck —unreachable
# Manage reflog information
git reflog expire —expire=0 —all
# Pack unpacked objects in a repository
git repack -a -d -l
# Prune all unreachable objects from the object database
@Zoramite
Zoramite / index.cfm
Created June 1, 2011 23:21
Railo XMLSearch with xmlns attribute test
<cfset tests = [
xmlParse('<?xml version="1.0"?> <html><body><ul><li>foo</li><li>bar</li></ul></body></html>'),
xmlParse('<?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml"><body><ul><li>foo</li><li>bar</li></ul></body></html>')
] />
<cfloop array="#tests#" index="i">
<cfset results = xmlSearch(i, '/html/body/ul/li') />
<cfdump var="#results#" />
</cfloop>
@Zoramite
Zoramite / git_aliases.sh
Created March 14, 2012 21:34
Git Bulk Aliases
alias gitstatus='find . -maxdepth 2 -path "*/.git" -print -execdir git status ";"'
alias gitfetch='find . -maxdepth 2 -path "*/.git" -print -execdir git fetch origin ";"'
alias gitpull='find . -maxdepth 2 -path "*/.git" -print -execdir git pull ";"'
alias gitpush='find . -maxdepth 2 -path "*/.git" -print -execdir git push ";"'
alias gitprune='find . -maxdepth 2 -path "*/.git" -print -execdir git prune ";"'
alias gitsub='find . -maxdepth 2 -path "*/.git" -print -execdir git submodule update --init --recursive ";"'
@Zoramite
Zoramite / jinja_deps.py
Last active July 22, 2019 01:04
Jinja2 Dependency Detection
"""Test how the Jinja templates"""
import os
import jinja2
from jinja2.ext import Extension
class DependenciesExt(Extension):
"""This extension attempts to track the dependencies used in a template."""
def filter_stream(self, stream):
@Zoramite
Zoramite / config.yml
Last active June 24, 2019 19:58
Complex Grow Workflow for Large Sites
version: 2
shortcuts:
restore_cache: &restore_cache
keys:
- &cache_key cache-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
install_grow: &install_grow
name: Grow Install
command: grow install
@Zoramite
Zoramite / config.yml
Last active June 24, 2019 19:37
Example Grow CircleCI Configuration
version: 2
jobs:
build:
working_directory: ~/grow
docker:
- image: grow/base:latest
steps:
- checkout
- restore_cache:
@Zoramite
Zoramite / gae_version_cleanup.sh
Last active June 21, 2019 17:26
GAE Version Cleanup
#!/bin/bash
while getopts :a:p: opt
do
case $opt in
a)
account="$OPTARG"
;;
p)
project_id="$OPTARG"
<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>!window.jQuery && document.write('<script src="js/jquery-1.4.2.min.js"><\/script>')</script>
@Zoramite
Zoramite / download_grow.sh
Created November 28, 2017 15:47
Grow Version Download
set -e
if [ -z "$1" ]; then
echo "usage: $0 <version>"
exit 1
fi
GROW_VERSION=$1
if [ ! -f $HOME/bin/gr/grow-$GROW_VERSION ]; then
@Zoramite
Zoramite / cleanup_branches.sh
Created November 1, 2017 20:40
Remove merged branches in git.
# Removes all the merged branches, ignoring master and staging branches.
git branch --merged | grep -vE '^\*|master$|staging$' | xargs -I % git branch -d %