Skip to content

Instantly share code, notes, and snippets.

View markstory's full-sized avatar

Mark Story markstory

View GitHub Profile
@predominant
predominant / changelog-cakephp.php
Created November 1, 2010 15:23
Automatically generate changelogs for CakePHP
<?php
$options = array(
'repo' => '/Users/predominant/Projects/cakephp/2.0/.git',
'titleOrder' => array(
'dev', 'alpha', 'beta', 'rc',
),
'regex' => '/(?<version>[\d\.]+)(?:-(?<title>[a-zA-Z]+)(?:(?<iteration>\d)?))?/',
'formats' => array(
'plaintext' => '| awk \'{print "Commit: ["$1"]\n"; $1=""; print "-"$0"\n"}\'',
'lighthouse' => '| awk \'{print "#### Commit: ["$1"](http://github.com/cakephp/cakephp/commit/"$1")\n"; $1=""; print $0"\n"}\'',
@lukaszkorecki
lukaszkorecki / example output
Created January 26, 2011 10:47
Simple Qunit test runner for PhantomJS
[10:44][~/dev/Mikrob.chrome master]: phantomjs testrunner.js file://`pwd`/test.html
Running tests
file:///Users/optimor/dev/Mikrob.chrome/test/collection_store_test.js:71 Clearing localStorage
Passed: 14, Failed: 1 Total: 15
[10:44][~/dev/Mikrob.chrome master]: echo $?
1
@phpdude
phpdude / middleware.py
Created December 4, 2011 14:15
Django subdomains Full support
Adds Django full subdomains urls upport for urlpatterns and reverse resolving.
Requires installation into settings.py
Allows you route and generate views various urls.
'''
Example:
'domain.com' -> ''
'domain.com/doc' -> 'doc'
@josegonzalez
josegonzalez / access.lua
Created December 3, 2012 18:26
Simple lua file enabling oauth support for nginx via nginx-lua and access_by_lua.
- certain endpoints are always blocked
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then
ngx.exit(403)
end
-- import requirements
local cjson = require "cjson"
-- setup some app-level vars
local app_id = "APP_ID"
@dadoonet
dadoonet / backup.sh
Created December 26, 2012 14:50
Backup Elasticsearch node
# Script to be placed in elasticsearch/bin
# Launch it from elasticsearch dir
# bin/backup indexname
# We suppose that data are under elasticsearch/data
# It will create a backup file under elasticsearch/backup
if [ -z "$1" ]; then
INDEX_NAME="dummy"
else
INDEX_NAME=$1
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@rochamarcelo
rochamarcelo / docker-compose.yml
Created July 31, 2023 17:26
docker-compose php-7-with-mysql
version: "3.1"
services:
mysql:
image: mysql:5.7
container_name: oneprojectday-mysql
working_dir: /application
volumes:
- .:/application
environment:
- MYSQL_ROOT_PASSWORD=secret