Skip to content

Instantly share code, notes, and snippets.

View jsdoodnauth's full-sized avatar

Joshua Doodnauth jsdoodnauth

View GitHub Profile
@jsdoodnauth
jsdoodnauth / LifeCycle.md
Last active January 3, 2016 09:38
ASP.NET Page Life Cycle
Page Event Typical Use
PreInit Use this event for the following: + Check the IsPostBack property to determine whether this is the first time the page is being processed. The IsCallback and IsCrossPagePostBack properties have also been set at this time. + Create or re-create dynamic controls. + Set a master page dynamically. +Set the Theme property dynamically. + Read or set profile property values.
Init Use this event to read or initialize control properties.
Init Complete Use this event to make changes to view state that you want to make sure are persisted after the next postback.
PreLoad Raised after the page loads view state, but after it processes postback data that is included with the Request
Load Use the OnLoad event method to set properties in controls and to establish database connections.
Load Complete Use this event for tasks that require that all other controls on the page be loaded.
PreRender Use the event to make final changes to the contents of the page or its control
@jsdoodnauth
jsdoodnauth / gist:2220048
Created March 27, 2012 20:31 — forked from jdjkelly/gist:2050551
301 Mania
Find.find('bouclair') do |f|
if f.match(/\.html\Z/)
file = File.open(f, "w")
file.puts('<html><head><meta http-equiv="Refresh" content="0; url=http://www.bouclair.com/" /></head><body><p>Our site has changed! Please follow <a href="http://www.bouclair.com/">this link</a>.</p></body></html>')
end
end
@jsdoodnauth
jsdoodnauth / SQLGroups.sql
Created March 27, 2012 20:31 — forked from jdjkelly/SQLGroups.sql
Script to delete groups
delete from groups where group_id in (
select group_id from groups
where group_id not in (
select productgroup.groupid from groups
inner join productgroup ON groups.group_id = productgroup.groupid
)
)
@jsdoodnauth
jsdoodnauth / gist:2220046
Created March 27, 2012 20:30 — forked from jdjkelly/gist:2147339
Bulk Ruby File Renaming
require 'fileutils'
filenames = Dir.glob("*.jpg")
filenames.each do |filename|
File.rename(filename, filename.gsub(/.jpg/, '') + "fr.jpg")
end