View silverstripe-assets-fixer.php
<?php | |
/** | |
* # SilverStripe Assets Fixer | |
* | |
* Interactive script to update file records in a SilverStripe site database. | |
* | |
* ## How it works | |
* | |
* For each File record in the database where Filename doesn't exist, the basename |
View .bash_profile
# Change to a site directory | |
# | |
# A site might be anything, but this was written to jump to web roots. | |
# Minimum config is to change the WEB_DIR variable. Adapted for drop-in | |
# use from the `site` function originally by @pieterv for @heyday | |
# | |
# Usage: site <dir> [path-within-dir] | |
WEB_DIR=/var/www/ |
View du-watch.py
#!/usr/bin/env python3 | |
# Disk usage watcher: | |
# A script that reports changes to disk usage between runs (for mounted devices) | |
# | |
# Written for use on Linux systems. | |
# | |
# When the percentage change for a device is greater than USAGE_CHANGE_NOTIFY_THRESHOLD, | |
# a line will be printed for that device. If the change is not greater than the threshold, | |
# nothing will be printed for that device. Output looks like this: |
View style.css
/** | |
* Compiled CSS for Passnote | |
* https://github.com/stecman/passnote | |
* | |
* Download this file to public/css/style.css if you don't want to compile the project's LESS: | |
* | |
* # Download using cURL | |
* $ curl https://gist.githubusercontent.com/stecman/c60a7b645104c565a517/raw/style.css -o public/css/style.css | |
* | |
* # or download using wget |
View phalcon-namespace-render.php
<?php | |
use Phalcon\Events\Event; | |
use Phalcon\Mvc\Application; | |
use Phalcon\Mvc\User\Plugin; | |
use Phalcon\Mvc\View; | |
/** | |
* Namespaced template rendering for the Phalcon PHP framework | |
* |
View hhclient_use.py
from subprocess import Popen, PIPE, STDOUT | |
import json | |
import sublime, sublime_plugin | |
""" | |
hhclient_use: copy fully qualified class name to clipboard | |
Copy the full class name at the current cursor position (or first class in the file) | |
to the clipboard. Requires the hh_client command line program to provide a JSON formatted | |
outline of the code in the focused buffer. |
View dev_spam_fix.sh
#!/bin/bash | |
# | |
# Make sure all untracked _ss_environment.php files use SS_SEND_ALL_EMAILS_TO | |
# Save yourself the expense of buying cupcakes for the dev team | |
# | |
function is_tracked() { | |
local filename="$1" |
View d2git.py
#!/usr/bin/env python | |
# | |
# Convert "versioning" with folders called d1, d2, d3.. into a git repository in the directory | |
# containing those folders. Written for use on *nix systems for people who weren't using version | |
# control software for a long time. | |
import os | |
import re | |
import time | |
import sys |
View beam-shell-profile.bash
# Helper shell functions and completions for use with Beam | |
# https://github.com/heyday/beam | |
# Print the .beamlog file for a beam target. | |
# Target defaults to live if not given | |
# | |
# usage: whatsup [target] | |
# | |
function whatsup() { | |
local server="${1-live}"; |
View php-server-helper-shell-profile.bash
# Run a PHP dev server on the first available port starting at 8000 | |
function serve() | |
{ | |
local port=8000 | |
# Try ports until an unused one is found | |
while nc -z localhost $port > /dev/null; do ((port++)); done; | |
echo -e "\033[44m>> Listening on port $port <<\033[0m" | |
php -S "0.0.0.0:$port" "$@"; |
OlderNewer