Skip to content

Instantly share code, notes, and snippets.

@tqheel
tqheel / gist:145ee286882d45176e607afb72ce9c6a
Created July 20, 2017 19:00
Get list of git branches in ascending order by committer date and output to clipboard
git branch --remote --sort=committerdate | clip
@tqheel
tqheel / gist:b4bac97b02cddbd140483448d12c461e
Created May 15, 2017 14:25
Merge branch b to branch a and resolve conflicts by taking all changes from branch b
git merge -s recursive -X theirs B
<style>
.orange{
height: 150px;
width: 225px;
}
.trans1 {
transform: translate(100px,0px);
-webkit-transition: -webkit-transform 3s ease-in;
}
.trans2{
@tqheel
tqheel / gist:4560463
Created January 17, 2013 22:31
Oracle PL/SQL for doing multiple Inserts with a UNION ALL statement, when a sequencer sets the primary key value.
insert into app_item(app_item_id, control_id, app_page_id, description, default_label)
select SEQ_APP_ITEM.nextval, a, b, c, d from
(
select'LabelNameSuffix' as a, 183 as b, 'Name Suffix' as c, 'Name Suffix' as d from dual
union all
select 'LabelFax', 184, 'Fax Number', 'Fax Number' from dual
)
;
@tqheel
tqheel / ForceAppRestart.cs
Created August 20, 2012 21:10
How to force an ASP.Net application to recompile
//As suggested at http://forums.asp.net/t/1569137.aspx/1
//This is an ugly hack but I needed a way to force the application to recompile on production server.
//Entity Framework was not updating cached values with the latest values from the db
//I tried many other suggested means of fixing this problem to no avail.
//This was a last resort. Has to be done within the context of an httpRequest object
System.IO.FileInfo fi = new System.IO.FileInfo(Server.MapPath("~/Web.config"));
fi.LastWriteTime = DateTime.Now;
//The hack changes the web.config's "last changed" date, which causes ASP.Net to recompile.
@tqheel
tqheel / commit-config.sh
Created July 19, 2012 16:09
Prevent ASP.Net Web.Config From Being Committed By Git
#Run this to reverse ignoring of changes to web.config so it gets committed.
git update-index --no-assume-unchanged path_to_file/web.config
@tqheel
tqheel / ForceRedirectOnSessionExpire.cs
Created July 18, 2012 20:37
ASP.Net: Force redirect when session expires
//source: http://www.codeproject.com/Articles/27073/How-to-Redirect-to-Another-Page-when-Session-Timeo
//Distributed under Codeplex Project Open License: http://www.codeproject.com/info/cpol10.aspx
private void CheckSessionTimeout()
{
string msgSession = "Warning: Within next 3 minutes, if you do not do anything, "+
" our system will redirect to the login page. Please save changed data.";
//time to remind, 3 minutes before session ends
int int_MilliSecondsTimeReminder = (this.Session.Timeout * 60000) - 3 * 60000;