Skip to content

Instantly share code, notes, and snippets.

View quickstep25's full-sized avatar

Doug Hill quickstep25

View GitHub Profile
@quickstep25
quickstep25 / get-referrer.js
Last active August 29, 2015 14:07
get http referrer
var url = "http://pheonix.local:5757/"
var referrer = url.match(/:\/\/(.+)/)[1];
@quickstep25
quickstep25 / git-total-reset
Created October 24, 2014 01:11
GitHub - Complete reset of repository to upstream / master.
git remote add upstream /url/to/original/repo
git fetch upstream
git checkout master
git reset --hard upstream/master
git push origin master --force
@quickstep25
quickstep25 / bs3-progress-bars.css
Created October 26, 2014 07:47
Bootstrap 3 Progress Bars Snippets
.progress {
position: relative;
height: 25px;
}
.progress > .progress-type {
position: absolute;
left: 0;
font-weight: 800;
padding: 3px 30px 2px 10px;
color: rgb(255, 255, 255);
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEDIT/TEXTWRANGLER REGULAR EXPRESSION GUIDE MODIFIED 2014-01-13 : 00:12
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
@quickstep25
quickstep25 / Bootstrap-Select---Knockout-3.2-Custom-Binding-Example.markdown
Last active June 2, 2020 17:12
Bootstrap Select - Knockout 3.2 Custom Binding Example

Bootstrap Select - Knockout 3.2 Custom Binding Example

Using KnockoutJS, I created a custom binding that enables the use of Bootstrap Select (selectpicker) jQuery plugin within a ViewModel

A Pen by Doug Hill on CodePen.

License.

@quickstep25
quickstep25 / regex-replace-parseHTML.js
Created February 22, 2015 19:18
Strip out line returns (hard and soft) as well as double spaces. Usually use this for parsing HMTL to string before making a new string template.
var data = data.replace(/(\r\n|\n|\r|\s{2})/gm, "");
@quickstep25
quickstep25 / Bootstrap---Select-2---Initialize-on-Click.markdown
Last active June 2, 2020 17:12
Bootstrap / Select 2 - Initialize on Click

Bootstrap / Select 2 - Initialize on Click

Click event bound to table row. When use clicks on TR, a list of options is shown.

A Pen by Doug Hill on CodePen.

License.

@quickstep25
quickstep25 / child_to_parent_model.js
Created July 9, 2015 09:37
Passing Parent Model to Child such that the child can reference parent values
var Item = function(name, parent) {
this.name = ko.observable(name);
this.isSelected = ko.computed(function() {
return this === parent.selectedItem();
}, this);
};
var ViewModel = function() {
this.selectedItem = ko.observable();
this.items = ko.observableArray([
@quickstep25
quickstep25 / relative_symbolic_link
Last active June 5, 2018 02:33
Creating a symbolic link to a relative path. NOTE: when entering the path name in the command line, do not start with a slash. A relative path entry will create a relative path symbolic link. NOTE: Enter this command in terminal when you are i
@quickstep25
quickstep25 / gitignore_icon.md
Created November 16, 2015 01:49
Icon? How to include this in your .gitignore file.

## Put the Icon? file in .gitignore After you've tried repeated to get .git to ignore this file, you have probably ended up here, reading this helpful tip.

Open up a terminal session:

# Navigate to your project root directory
cd path/to/projectname/

Edit your .gitignore file