Skip to content

Instantly share code, notes, and snippets.

Avatar

Simon Bingham simonbingham

View GitHub Profile
@simonbingham
simonbingham / new_gist_file_0
Created May 10, 2017
Match CFFUNCTION tags without OUTPUT
View new_gist_file_0
^((?!output)[^>\n\r])*<cffunction(((?!output)[^>])*)>
View new_gist_file_0
[0K$ curl --location 'https://www.ortussolutions.com/parent/download/commandbox/type/bin' -o /tmp/box.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 208 0 208 0 0 1168 0 --:--:-- --:--:-- --:--:-- 1664
0 38.5M 0 12888 0 0 17032 0 0:39:35 --:--:-- 0:39:35 17032
54 38.5M 54 21.0M 0 0 16.4M 0 0:00:02 0:00:01 0:00:01 39.9M
100 38.5M 100 38.5M 0 0 24.7M 0 0:00:01 0:00:01 --:--:-- 47.9M
@simonbingham
simonbingham / new_gist_file_0
Created Jul 14, 2016
Git: Delete all local branches apart from master
View new_gist_file_0
git branch | grep -v "master" | xargs git branch -D
@simonbingham
simonbingham / new_gist_file_0
Created May 5, 2016
Git: Removing unwanted commits after a screwed up rebase
View new_gist_file_0
git fetch
git checkout -t origin/your-branch
git reset --hard origin/master
git cherry-pick d5ea0fa5 bbd9b216 b4aa42d7 # shas of commits you wish to keep
git push -f
View new_gist_file_0
git submodule add https://github.com/teamcfadvance/CFSelenium.git framework/CFSelenium
@simonbingham
simonbingham / new_gist_file.cfm
Created Apr 15, 2015
convertSecondsToTimeString()
View new_gist_file.cfm
<cfscript>
function convertSecondsToTimeString(seconds) {
local.hours = arguments.seconds \ 3600;
local.minutes = (arguments.seconds \ 60) mod 60;
local.seconds = (arguments.seconds) mod 60;
return numberformat(local.hours, "0") & ":" & numberformat(local.minutes, "00") & ":" & numberformat(local.seconds, "00");
}
</cfscript>
<cfoutput>
@simonbingham
simonbingham / new_gist_file_0
Created Aug 29, 2014
Git: Cherry picking a commit to a new branch
View new_gist_file_0
git checkout the_branch_with_the_target_commit
git pull
git checkout -b the_new_branch_name
git cherry-pick the_target_commit_sha
View new_gist_file.cfm
<cffunction name="queryToTable" access="public" returntype="string" output="false" hint="I convert a query to an HTML table">
<cfargument name="data" type="query" required="true" hint="The query object">
<cfif arguments.data.recordCount EQ 0>
<cfreturn "No records were returned.">
</cfif>
<cfsavecontent variable="local.result">
<cfoutput>
<table class="table">
@simonbingham
simonbingham / new_gist_file_0
Created Jun 4, 2014
Git: Recovering lost commits
View new_gist_file_0
git reflog show # find the sha of the last lost commit
git reset --hard <last-commit-sha>
git push --force origin/<branch-name>
@simonbingham
simonbingham / new_gist_file.md
Last active Dec 4, 2015
Pull request template
View new_gist_file.md

--- Integration Branch ---

What the changes do

The acceptance criteria

Story: The course grain link

Feature Branches

You can’t perform that action at this time.