Every once in a while, I start changing code before switching to a new branch... then.... nuts!
I need to move these uncommitted changes to a new branch, or ... throw them away and start again.
Two Options:
1) You can just checkout to the new branch and then commit. You don't lose your uncommitted changes when moving to another branch.
git checkout -b new-branch-name
git add .
2) Use Git Stash as a copy & paste:
git stash
git checkout other-branch-name
git stash apply
Thanks to Here
Tuesday, March 26, 2013
Monday, March 11, 2013
Git Production Server Updating
A quick note,
If you want to update a production server's versioned files, and discard local changes (which there shouldn't be any... right?)
discard local changes, and replace them with the most recent commit that exists on the github server (origin) on branch production:
> git reset --hard origin/production
Thanks for help on this from: Here
If you want to update a production server's versioned files, and discard local changes (which there shouldn't be any... right?)
discard local changes, and replace them with the most recent commit that exists on the github server (origin) on branch production:
> git reset --hard origin/production
Thanks for help on this from: Here
Thursday, February 21, 2013
Coldfusion Web Application Saving to DropBox
Every now and again, I'm working on a project that renders something that an administrative user needs to take with them; be it a pdf, or a csv representation of a report. Either way, once it is completed, I used to use coldfusion's cfcontent tag to dump the stream to the browser....which I've always thought of as pulling a fast-one on the browser, tricking it into thinking it is a physical file on disk to be downloaded, and Bob's your uncle.
This works, but let's be honest, cfcontent seems a bit of a sketchy way of delivering a file.... but it works... unless you're on shared hosting, in which case it's disabled... or will be, or should be, or will-be-until-you're-in-production.
I started out looking through the API for Dropbox, to try and figure out how to get a web application to create a new file in dropbox, which is totally possible... but much too complicated, as it has to be keyed to a specific dropbox account.
Then it dawned on me... I can create files on the disk... cfdocument allows you to specify a file name, so does cfimage, and cffile lets you create almost anything... Dropbox (and Google Drive) , are after all just a folder on the disk.. which is controlled by dark magic :-)
And this idea actually works... you just target the Dropbox folder, get your web app to store the generated file here, and the cloud-storage mechanisms do the heavy lifting for you. You could even create a dropbox folder hierarchy to keep things tidy.
This works, but let's be honest, cfcontent seems a bit of a sketchy way of delivering a file.... but it works... unless you're on shared hosting, in which case it's disabled... or will be, or should be, or will-be-until-you're-in-production.
I started out looking through the API for Dropbox, to try and figure out how to get a web application to create a new file in dropbox, which is totally possible... but much too complicated, as it has to be keyed to a specific dropbox account.
Then it dawned on me... I can create files on the disk... cfdocument allows you to specify a file name, so does cfimage, and cffile lets you create almost anything... Dropbox (and Google Drive) , are after all just a folder on the disk.. which is controlled by dark magic :-)
And this idea actually works... you just target the Dropbox folder, get your web app to store the generated file here, and the cloud-storage mechanisms do the heavy lifting for you. You could even create a dropbox folder hierarchy to keep things tidy.
Monday, January 14, 2013
CFEclipse Stack Overflow org.cfeclipse.cfml.editors.CFMLEditor
In an attempt to import the CFWheels project from GITHub into Eclipse today, I was unable to open a couple of files without getting "Unable to create editor ID org.cfeclipse.cfml.editors.CFMLEditor: Editor could not be initialized"
After some quick searches, I found this post I've edited my eclipse.ini files last line to be:
-Xss10m
I tired it initially with the suggested -Xss2048k but it didn't fix the problem... since I have more ran that I know what to do with... I figured what the heck if 2 megs didn't work, here's 10 megs... and now its working again.
Tuesday, January 8, 2013
Railo and Fusion Reactor Trouble with Datasource Wrapper
I came across a bug I thought was in Fusion-Reactor recently wrapping a data-source with Railo 3.3.4.003. It was actually that Railo wasn't putting the resultant primary key from an SQL insert statement into the correct structure key in the returned query object... at any rate, it's now fixed... but in Railo 4.0.3.000
https://issues.jboss.org/browse/RAILO-2178
How To: Upgrade Railo 3 to 4
Amongst other things, today I'm pushing forward on upgrading Railo from 3.x to 4.x. To begin with, I'm going to switch over my desktop workstation (IIS 7, Windows 7x64, SQL Express 2012, CF-Wheels, Fusion-Reactor) to see how it goes.
The big push for me is that I can't activate my Fusion Reactor's JDBC request monitoring easily in Railo 3.x because of the issue in this blog post which causes CF-Wheels to have no idea what a newly inserted row's primary key is. I've posted some feedback about possible work arounds at cf-wheels community site thread here: https://groups.google.com/forum/?fromgroups=#!topic/cfwheels/JJ-VrEE85ok
1) Uninstalled exising Railo 3.x, which removes the jakarta/isapi connector from IIS
2) Double check that jakarta ISAPI filter entry is removed from IIS.
3) Install Railo 4.Walk Thru: https://github.com/getrailo/railo/wiki/How-To%3A-Upgrade-from-Railo-3.x-to-Railo-4.x
Railo admin required the removal of the following JAR files from Railo/lib before it could apply the patch to 4.0.3.001 because they were in use. I specifically patched to this version because of the issue in this blog post
4) Update SQL Driver. Railo 4.x ships with JDBC 3, I needed JDBC 4, as JDBC 3 has a known bug, which in my case, using Coldfusion CFDBINFO doesn't work.. which only matters.. because CF-Wheels is built around this tag.
5) At this point, the Railo 4.x installer did its magic nicely, and was up and running... of course, without any of my data sources... since I don't want to re-enter them:
- Copy your data sources ( The <data-source /> nodes ) from the xml file at \Railo Inst Folder\lib\railo-server\context\railo-server.xml into your new installation at the same location.
6) So, everything is good now.. except: I need Paul Klinkenberg's most excellent CFCSV tag installed. (url below) Railo 4.x has changed the way extensions are installed. Download the ZIP and upload it to your railo admin.
7) Have you done this yet. how did it go?
Notes:
Reference Links:
Railo 4.x Jar Files: http://www.getrailo.org/index.cfm/download/
Specifically, under "Railo 4 Installers" in the bottom right-hand corner: http://www.getrailo.org/down.cfm?item=/railo/remote/download/4.0.2.002/custom/all/railo-4.0.2.002-jars.zip&thankyou=false
SQL JDBC 4.0 Driver Jar's: http://www.microsoft.com/en-us/download/details.aspx?id=11774
Paul Klinkenberg's most excellent CFCSV tag (Thanks Paul.. you Rock!!): http://www.getrailo.org/index.cfm/extensions/browse-extensions/cfcsv/
The big push for me is that I can't activate my Fusion Reactor's JDBC request monitoring easily in Railo 3.x because of the issue in this blog post which causes CF-Wheels to have no idea what a newly inserted row's primary key is. I've posted some feedback about possible work arounds at cf-wheels community site thread here: https://groups.google.com/forum/?fromgroups=#!topic/cfwheels/JJ-VrEE85ok
1) Uninstalled exising Railo 3.x, which removes the jakarta/isapi connector from IIS
2) Double check that jakarta ISAPI filter entry is removed from IIS.
3) Install Railo 4.Walk Thru: https://github.com/getrailo/railo/wiki/How-To%3A-Upgrade-from-Railo-3.x-to-Railo-4.x
Railo admin required the removal of the following JAR files from Railo/lib before it could apply the patch to 4.0.3.001 because they were in use. I specifically patched to this version because of the issue in this blog post
- ehcache.jar
- slf4j.jar
- railo-sl4j.jar
4) Update SQL Driver. Railo 4.x ships with JDBC 3, I needed JDBC 4, as JDBC 3 has a known bug, which in my case, using Coldfusion CFDBINFO doesn't work.. which only matters.. because CF-Wheels is built around this tag.
5) At this point, the Railo 4.x installer did its magic nicely, and was up and running... of course, without any of my data sources... since I don't want to re-enter them:
- Copy your data sources ( The <data-source /> nodes ) from the xml file at \Railo Inst Folder\lib\railo-server\context\railo-server.xml into your new installation at the same location.
6) So, everything is good now.. except: I need Paul Klinkenberg's most excellent CFCSV tag installed. (url below) Railo 4.x has changed the way extensions are installed. Download the ZIP and upload it to your railo admin.
7) Have you done this yet. how did it go?
Notes:
- If you want to patch to upgrade your Railo to 4.x just get the Jar files. This solution doesn't however update your world to the Boncode connector, which fixes the bug which makes url rewriting almost impossible as far as I could figure out. https://issues.jboss.org/browse/RAILO-1712
- Tomcat's Server.xml mapping... no longer needed? Is this related to the new Boncode connector? I never moved over my mappings to the new railo installation... but it works.
Reference Links:
Railo 4.x Jar Files: http://www.getrailo.org/index.cfm/download/
Specifically, under "Railo 4 Installers" in the bottom right-hand corner: http://www.getrailo.org/down.cfm?item=/railo/remote/download/4.0.2.002/custom/all/railo-4.0.2.002-jars.zip&thankyou=false
SQL JDBC 4.0 Driver Jar's: http://www.microsoft.com/en-us/download/details.aspx?id=11774
Paul Klinkenberg's most excellent CFCSV tag (Thanks Paul.. you Rock!!): http://www.getrailo.org/index.cfm/extensions/browse-extensions/cfcsv/
Monday, January 7, 2013
SQL Exclusion Join
So, what if you want to see if records in one table exist in another one? For example, two mail lists.. with tables that may not even have similar layouts, but have similar-ish fields, like first, last, email.... LEFT OUTER JOIN to the rescue.
Special thanks to: http://www.xaprb.com/blog/2005/09/23/how-to-write-a-sql-exclusion-join/
Fields that have shown up on the right-hand side of the join exist in both tables, and you can filter them out using a where clause.
Special thanks to: http://www.xaprb.com/blog/2005/09/23/how-to-write-a-sql-exclusion-join/
Fields that have shown up on the right-hand side of the join exist in both tables, and you can filter them out using a where clause.
Subscribe to:
Posts (Atom)