# replace
-
JavaScript _ 2020-11-29
Replacing code for production with Babel transformation
If you are building some sort of an app, Babel is probably part of your build system. It is that thing which converts our fancy code to valid, working in a browser, JavaScript. Just recently at work I had to design a solution that swaps a class based on the environment. Or in another words, we have logic that should not reach our users. The file should be available locally and on our staging environment but not in production. A tiny Babel plugin was the cheapest solution for me so I decided to share the result.
-
JavaScript _ 2013-06-15
Javascript string replace and regular expression
The replace method in JavaScript is pretty much the same as in the other languages. Replace part/s of a string with something else. However, there are some tricky moments and I wanted to write this article, because I met this problem several times in the past. Actually, very often I use my blog as a documentation for myself and this is one of those cases. Probably I'll be in the same situation after week or so and I'll just check here for the proper solution.
-
PHP _ 2013-02-02
Cleaning up <pre> tag content
I'm blogging for different technologies, but very often I need to add some code in my articles. This little PHP function helps me to keep the text in my
tags clean for prettify. It simply removes the
's and keeps the html tags. -
PHP _ 2010-12-30
PHP: Simple javascript obfuscator (merging files)
Currently I'm working on a big JavaScript project. It has a lot of files that have to be compressed. I wrote a simple php class that merges all the files into one. It has also a useful simple obfuscator method.
-
PHP _ 2010-11-24
PHP: find links in a string and replace them with actual html link tags
Currently I'm working on an application that gets data from Twitter. The tweet's string contains links that have to be transformed into html link tags. Here is a simple PHP function that helped me.
-
ActionScript _ 2010-06-30
Remove tags from a string in AS3
A couple of months ago I integrated a nice WYSIWYG editor written in Flex in my CMS. It worked fine, till yesterday I needed to add more features like text formatting and font color changing. As you know the Flex RichTextEditor component adds some additional tags that I definitely don't want to send to the database. So I wrote a simple function to remove these tags.