Skip to content

Instantly share code, notes, and snippets.

View quickstep25's full-sized avatar

Doug Hill quickstep25

View GitHub Profile
@quickstep25
quickstep25 / last_login_access.txt
Last active June 2, 2020 17:09
MacOS Login Attempts
-- Show Last Login(s)
last -10
-- Show Successful Logins
grep -i login /var/log/system.log
-- Show Failed Attempts
grep -i authe /var/log/system.log
| Variable | Output |
|--|--|
| %s | String |
| %d | Integer |
| %f | Float Point Value |
| %o | DOM Object |
| %0 | JavaScript Object |
| %c | Apply CSS Rules |
Example:
@quickstep25
quickstep25 / app.html
Last active March 3, 2018 21:54
Example using a Tree widget to show how components are used with x-templates. REF: https://jsfiddle.net/pnqzspoe/1362/
<!-- item template -->
<script type="text/x-template" id="item-template">
<li>
<div
:class="{bold: isFolder}"
@click="toggle"
@dblclick="changeType">
{{ model.name }}
<span v-if="isFolder">[{{ open ? '-' : '+' }}]</span>
</div>
@quickstep25
quickstep25 / update_branch_from_master
Last active November 19, 2015 03:46
Update branch to the latest master
# Checkout the branch
git checkout branchname
# Get the latest master
git fetch
# Set to lastest master
git rebase origin/master
# Push changes
@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

@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 / 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 / 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 / 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---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.