One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| after "deploy", "deploy:cleanup" | |
| after "deploy:update_code", "composer:install" | |
| before "composer:install", "composer:copy_vendors" | |
| after "composer:install", "phpunit:run_tests" | |
| namespace :composer do | |
| desc "Copy vendors from previous release" | |
| task :copy_vendors, :except => { :no_release => true } do | |
| run "if [ -d #{previous_release}/vendor ]; then cp -a #{previous_release}/vendor #{latest_release}/vendor; fi" | |
| end |
| #!/usr/bin/env bash | |
| # checks if branch has something pending | |
| function parse_git_dirty() { | |
| git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*" | |
| } | |
| # gets the current git branch | |
| function parse_git_branch() { | |
| git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" |
| #!/bin/bash | |
| mkdir -p ~/.ssh | |
| # generate new personal ed25519 ssh keys | |
| ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <[email protected]>" | |
| ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <[email protected]>" | |
| # generate new host cert authority (host_ca) ed25519 ssh key | |
| # used for signing host keys and creating host certs |
| # delete local tag '12345' | |
| git tag -d 12345 | |
| # delete remote tag '12345' (eg, GitHub version too) | |
| git push origin :refs/tags/12345 | |
| # alternative approach | |
| git push --delete origin tagName | |
| git tag -d tagName |
| sub vcl_deliver { | |
| if (req.url ~ "/fonts/") { | |
| set resp.http.Access-Control-Allow-Origin = "*"; | |
| set resp.http.Access-Control-Allow-Methods = "GET, OPTIONS"; | |
| set resp.http.Access-Control-Allow-Headers = "Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token"; | |
| } | |
| } |
| function parse_duration($duration, $resultType){ | |
| $matches = array(); | |
| preg_match('/^(-|)?P([0-9]+Y|)?([0-9]+M|)?([0-9]+D|)?T?([0-9]+H|)?([0-9]+M|)?([0-9]+S|)?$/', $duration, $matches); | |
| if(!empty($matches)){ | |
| foreach($matches as &$match){ | |
| $match = preg_replace('/((?!([0-9]|-)).)*/', '', $match); | |
| } | |
| ######################################################################### | |
| # This is an example VCL file for Varnish 4.0. # | |
| # From: https://gist.github.com/davidthingsaker/6b0997b641fdd370a395 # | |
| # LICENSE: If this could help you in any way, you are obliged to use it # | |
| # for free with no limitations. # | |
| ######################################################################### | |
| # Marker to tell the VCL compiler that this VCL has been adapted to the | |
| # new 4.0 format. |
| # The command finds the most recent tag that is reachable from a commit. | |
| # If the tag points to the commit, then only the tag is shown. | |
| # Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object | |
| # and the abbreviated object name of the most recent commit. | |
| git describe | |
| # With --abbrev set to 0, the command can be used to find the closest tagname without any suffix: | |
| git describe --abbrev=0 | |
| # other examples |
| http://apassant.net/2012/01/16/timeout-for-html5-localstorage/ | |
| var hours = 24; // Reset when storage is more than 24hours | |
| var now = new Date().getTime(); | |
| var setupTime = localStorage.getItem('setupTime'); | |
| if (setupTime == null) { | |
| localStorage.setItem('setupTime', now) | |
| } else { | |
| if(now-setupTime > hours*60*60*1000) { | |
| localStorage.clear() |