Posts

Get slug of the current archive page of a taxonomy in Wordpress

To get the taxonomy slug of the current archive page, for example: You installed an event plugin which allows you to create session tracks ("session-track", a taxonomy), e.g: session-1, session-2... (terms) And in the archive page of those session tracks, to get the slug of the current one, you just need to call: <?php $tax_slug = get_query_var( 'event-categories' ); echo $tax_slug; ?> If you are on session track 1 archive page, the result will be: session-1 For more information about taxonomies and terms in WordPress, please read: [0]  http://codex.wordpress.org/Taxonomies [1]  http://code.tutsplus.com/tutorials/understanding-and-working-with-taxonomies-and-terms-in-wordpress--cms-21051

A great tool to edit SVG image's source online

Image
I just design a vector image with Inkscape and I want to do something more with the xml source. Eventhough Inkscape has a xml editor (CTRL + SHIFT + X) but It's not intuitive enough. Here we go, this online tool is pretty cool: http://mrdoob.com/projects/htmleditor/ The editor allows me to modify SVG's XML source and see the changes instantly, visually.

Why did I quit social media?

I decided to get out of the social media world earlier this year because of several reasons: Information overloaded. After reading this book:  http://www.dangtrinh.com/2015/01/who-am-i.html . Too much noise and people talks shit all the time. (to be updating...)

Making vector out of bitmap image using Inkscape

Image
In some cases I also have to do the design part of some websites. Something like logos, banner, t-shirts etc...  The job is way easier with the free open-sourced tool names Inkscape. In this blog post I will show you the technique I used to convert a bitmap image to vector (not pixelated when scaling). 1. Import the bitmap image as embed: >> File >> Import... >>  2. Select the image and choose Path >> Trace Bitmap...  and set the settings as following: * Color * Stack scans * Scan: 2 * Remove background (to make the background transparent) >> click Update to preview >> click OK to apply the trace: 3. Copy the created layer (the black one) into another Inkscape document, save it and you have a vector version of the original bitmap image: Pretty cool huh? \m/

Responsive tables with StackTableJS

Image
Sometimes the tables will break your website because it's too big, even-though you are using bootstrap. Here is the savior: Github repository:   https://github.com/johnpolacek/stacktable.js/ Official website:   http://johnpolacek.github.io/stacktable.js/ Basically, StackTableJS will transform your horizontal tables into vertical tables (the headers). 0. Download the js and css file from the link above (stacktable.css and stacktable.js). 1. Make sure the table is well-formed: <table id="mytable"> <thead> <tr> <th>Title 1</th> <th>Title 2</th> </tr> </thead> <tbody> <tr> <td>...</td> <td>...</td> <tr> ... </tbody> </table> 2. Include the stacktable css, add this inside the head tag: <link href="/js/stacktablejs/stacktable.css" rel="stylesheet" /> 3. Include the stacktable js , add this before the body e...

Quote of the day

Image
"There are more scary things inside than outside." ~Toni Morrison, Paradise.

What is your home?

Image
This is a great talk about "never-give-up" kinda things when pursuing your dream by Elizabeth Gilbert, author of a The New York Times Best Seller book " Eat, Pray, Love ". But, to me it's about herself defining home. What is her home? What is your home? Source:  https://www.ted.com/talks/elizabeth_gilbert_success_failure_and_the_drive_to_keep_creating Home is where your heart is, people say. And yes it is. Gilbert's home is writing. That's where her heart is: "And you have to understand that for me, going home did not mean returning to my family's farm. For me, going home meant returning to the work of writing because writing was my home, because I loved writing more than I hated failing at writing, which is to say that I loved writing more than I loved my own ego, which is ultimately to say that I loved writing more than I loved myself. And that's how I pushed through it." That is where you go back to whenever you feel bad or i...