Skip to content

Instantly share code, notes, and snippets.

David Parker boldfacedesign

Block or report user

Report or block boldfacedesign

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@boldfacedesign
boldfacedesign / gist:7264260
Created Nov 1, 2013
Call client-side JavaScript from code behind 'EPiServer syntax'.
View gist:7264260
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 Nov 4, 2013
Rebind/Refire JavaScript after partial postback
View gist:7301723
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
}
@boldfacedesign
boldfacedesign / gist:7339612
Last active Dec 27, 2015
Make IIS/IISExpress accept remote connections
View gist:7339612
Open Command Line prompt in administrator mode:
Type:
netsh http add urlacl url=http://machine_name:port_number/ user=everyone
where 'machine_name' is you machine(hostname) - to find this open command propmt and type 'hostname'
and 'port_number' is your project port binding.
@boldfacedesign
boldfacedesign / gist:7357899
Created Nov 7, 2013
make page editable via console in JS
View gist:7357899
document.body.contentEditable = 'true';
@boldfacedesign
boldfacedesign / Google maps geocode.txt
Last active Feb 15, 2019
Google maps geocode multiple addresses and add info windows
View Google maps geocode.txt
var locations = [
['Bondi Beach', '850 Bay st 04 Toronto, Ont'],
['Coogee Beach', '932 Bay Street, Toronto, ON M5S 1B1'],
['Cronulla Beach', '61 Town Centre Court, Toronto, ON M1P'],
['Manly Beach', '832 Bay Street, Toronto, ON M5S 1B1'],
['Maroubra Beach', '606 New Toronto Street, Toronto, ON M8V 2E8']
];
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 10,
View watch.rb
#!/usr/bin/env ruby
require 'tempfile'
require 'fileutils'
# Signals
trap("SIGINT") { exit }
# Setup
TARGET_FOLDER = ARGV[0]
TARGET_URL = ARGV[1]
@boldfacedesign
boldfacedesign / JS Sleep
Created Jan 28, 2014
JavaScript sleep (wait) function
View JS Sleep
function sleep(milliseconds) {
var startTime = new Date().getTime();
while (new Date().getTime() < startTime + milliseconds);
}
sleep(10000);
@boldfacedesign
boldfacedesign / Sublime wrap multiple lines.txt
Last active Aug 29, 2015
wrap multiple lines in tag Sublime text
View Sublime wrap multiple lines.txt
Use "Selection/Split into Lines" (Ctrl+Shift+L on Windows and Linux, Cmd+Shift+L on OS X)
(Shift+Alt+W) wrap lines in tag
@boldfacedesign
boldfacedesign / C# 2 digit number
Created Mar 17, 2014
C# make sure number has minimum of 2 didgits
View C# 2 digit number
n.ToString("D2")
http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx
View shopify collection loop
{% if c.handle contains collection.handle and c.handle != collection.handle %}
<li class="{{ forloop.index }}">
<a href="{{ c.url }}" title="{{ c.title }}">
<span class="product-border"></span>
<div class="img-wrap">
<span class="img-wrap__inner">
<img src="{{ c.image.src | collection_img_url: 'medium' }}">
</span>
</div>
You can’t perform that action at this time.