Posts Tagged ‘JavaScript’
Refactor My Code - I Wish I’d Thought of It!
Written by Chris on August 15, 2008 – 9:03 pm -refactormycode.com is a fledgling website setup as a project by French Canadian Ruby Developer Marc-André Cournoyer and basically it's like a coding forum without the usual forum junk, style and obfuscation of content (forums for me are always a pain to use because of the tiers of information you have to go through).
It's a great looking website covering all the current major programming languages (at least when thinking of the web) and the idea behind it, though simple, seems to work really well.
Basically, you have some code that works, but you want to make it better, more efficient, or just tidier. So, you post your code sample and other people suggest changes. It's kind of like yahoo answers for developers or the comments foot of the PHP manual.
The code to be refactored, so far in the PHP section at least, has been of a reasonable standard i.e. that of at least intermediate developers, which is great as these services can tend to get flooded by newbies who don't know their $i++ from their ++$i :p and rapidly lose interest for me.
So far there are only a few PHP samples on there to comment on but I think, as the site begins to grow, there will be a wealth of well developed and critiqued code that serves as good examples or directly useable functionality.
So far I can't really fault it, other than making the "Best" link clearer by calling it "Best Refactorors" or something similar, and providing some closed, or accepted answer(s) type functionality to stop a thread getting out of hand (it could be that this exists already but I just haven't seen it yet). Maybe even an option to download each refactoring as a plain text file could be useful.
So, to round up, as you can probably tell, I love this site and you can see my standing in the community in the foot of this page! Keep up the great work Marc and I hope your site develops in the way it deserves and gets the recognition it should!
Popularity: 100% [?]
Sphere: Related ContentTags: action, code, development, Flash, JavaScript, PHP, post, script, webservices, website
Posted in Flash, JavaScript, PHP, Web Development | 1 Comment »
Advanced Syntax-Hilighting Online Code Editors - A Wordpress IDE?
Written by Chris on July 2, 2008 – 6:10 pm -When I write plugins for wordpress I like to do it on a test blog in a live environment.
Maybe not the best idea, but it's how I like to do it, and it also flags up any weird and wonderful restrictions to the development of the plugin as a result of my hosting company's security policy.
For a while now I've worked with just the plain old plugin editor that comes with wordpress, but this is cumbersome to say the least and as such I went looking for a syntax highlighting editor which I could (if necessary) convert into a plugin to (ironically enough) improve the plugin editor.
Turns out that there's quite a few good syntax highlighting online code editors available (list at the end of this post) and at least one neat one (CodePress) has been converted to a wordpress plugin for theme editing and plugin editing.
This is a really great start, but there's a couple of things I'd really like to see to progress this work - If I have the time I'll do it myself, otherwise someone else reading this post may like to take it up!
Basically the current Codepress for wordpress plugin is missing (in my opinion) a few additional functions to create backups of the plugin or theme files you're working on, to an extent a rudimentary versioning system could and should be implemented within the editor.
There should be an option to package up the plugin you're editing and release it to the community/tie updates into the automatic plugin updater of 2.5
The current CodePress release is great but what would make it even greater would be code hinting when editing.
I don't know enough JavaScript to say whether or not this is possible but it would be cool for the editor to notice that you've just typed or started to type a PHP (or other language) function name, and provide you with a syntax hint for the function.
This would work (in my mind) by noticing the opening of ( and then checking what preceded it back to the last space or operator (*, ., /, etc.), then looking up this string from a function definition array and displaying a tooltip near where you are editing in the text area to remind you of the syntax - possibly with an autocomplete if you press enter.
I think the main problem with this is knowing where you are in the text area to display the div with the tool tip text in it in the right place. I know you can monitor where you are in a text area in terms of columns and rows, so surely if you know the location of the start of the text area and the size of the character in the text area and the co-ordinates of the cursor in the text area via row/column values you should be able to determine the optimal position for the <div>?
I think it would be really great to see that kind of functionality in any of the online code editors listed below on it's own let alone any other stuff such as versioning that I've already mentioned.
So there it is!
I probably will end up doing some work on the codepress plugin myself from a versioning point of view, but if any one else out there can figure out a way of doing the code hinting in JS that'd be fantastic!
Existing On line Code Editors:
Autosuggest example (could be used to provide the tool tip if the positioning is worked out): http://gadgetopia.com/post/3773
Wordpress plugins:
- Codepress plugin for Wordpress: http://rulesplayer.890m.com/blog/?page_id=4
- Flash based code editor with wordpress plugin (dated solution IMO): http://www.flashtexteditor.com/ftf/
Popularity: 22% [?]
Sphere: Related ContentTags: code, codepress, editor, high, highlight, java, JavaScript, light, PHP, plugin, press, script, syntax, theme, Wordpress
Posted in JavaScript, PHP, Plugins, Pot O' Ideas, Web Development, Wordpress | No Comments »
Making Flash Sites Easy
Written by Chris on September 21, 2007 – 2:11 pm -OK, so a lot of people probably already know about this nifty little javascript but I didn't so I thought I'd give a quick mention.
I was talking with a friend of mine earlier today about flash sites and what happens when a search engine bot tries to index them - presumably they can't access the content of the flash movies directly and as such content gets missed, right?
Well, though this is probably true the SWFObject (http://blog.deconcept.com/swfobject/) javascript gets around this very neatly by rewriting <div> tags to show flash content if the plugin exits or just offing up a html alternative if you don't have flash or even javascript installed (or turned on).
This neat solution means that any search engine bot that can't deal with flash fully can very easily get relevant information from the page for its indexes, and also any visitor using a non-flash browser or who doesn't have the flash plugin installed can still view the site to a usable extent.
Nice work, and thanks to Jon for pointing it out!
You can visit Jon's sites here:
http://www.welshpanoramas.com/
http://www.nosstazenith.co.uk/
Popularity: 7% [?]
Sphere: Related ContentTags: Flash, JavaScript, swf, swfobject
Posted in Flash, JavaScript | 2 Comments »














Feed 
