Skip to content

Instantly share code, notes, and snippets.

View boldfacedesign's full-sized avatar

David Parker boldfacedesign

View GitHub Profile
@boldfacedesign
boldfacedesign / Excel GUID Macro
Created June 2, 2014 14:01
Excel Macro - Fill blank cells with GUID (VBA)
Sub fillBlankGUIDs()
For Each c In Selection
If IsEmpty(c.Value) Then c.Value = Mid$(CreateObject("Scriptlet.TypeLib").GUID, 2, 36)
Next
End Sub
@boldfacedesign
boldfacedesign / .exe symlink
Created June 4, 2014 10:46
Create symlink to executable files
@boldfacedesign
boldfacedesign / chmod numeric codes
Created January 30, 2015 20:12
chmod numeric codes
0 == --- == no access
1 == --x == execute
2 == -w- == write
3 == -wx == write / execute
4 == r-- == read
5 == r-x == read / execute
6 == rw- == read / write
7 == rwx == read / write / execute
@boldfacedesign
boldfacedesign / Restart OS X from terminal
Created July 1, 2015 21:04
Restart OS X from terminal
sudo shutdown -r now
@boldfacedesign
boldfacedesign / imports_timing.js
Last active August 29, 2015 14:26 — forked from ebidel/imports_timing.js
HTML Imports Resource Timing performance
// Know how fast your HTML Imports are
var imports = document.querySelectorAll('link[rel="import"]');
[].forEach.call(imports, function(link) {
var entries = performance.getEntriesByName(link.href);
console.info('=== HTML Imports perf ===');
entries.forEach(function(e) {
console.log(e.name, 'took', e.duration, 'ms');
});
});
@boldfacedesign
boldfacedesign / Git squash commits
Created July 30, 2015 08:44
Git squash commits
# Reset the current branch to the commit just before the last 12:
git reset --hard HEAD~12
# HEAD@{1} is where the branch was just before the previous command.
# This command sets the state of the index to be as it would just
# after a merge from that commit:
git merge --squash HEAD@{1}
# Commit those squashed changes. The commit message will be helpfully
# prepopulated with the commit messages of all the squashed commits:
COMMAND + ALT + [
COMMAND + ALT + ]
@boldfacedesign
boldfacedesign / Show SSH public key
Created September 11, 2015 13:08
Show SSH public key
cat ~/.ssh/id_rsa.pub
@boldfacedesign
boldfacedesign / gist:7264260
Created November 1, 2013 11:39
Call client-side JavaScript from code behind 'EPiServer syntax'.
System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "name_of_function", "function()", true);
Note: Client side JS function must be defined in the global name space
@boldfacedesign
boldfacedesign / gist:7301723
Created November 4, 2013 12:21
Rebind/Refire JavaScript after partial postback
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(onBeginRequest);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(onEndRequest);
function onBeginRequest() {
//initiate on start of postback
}
function onEndRequest() {
//initiate at end of postback
}