WordPress Bhaktapur first formal meeting


Yesterday group of WordPress Bhaktapur had the first formal meeting at FnClick. Even though a small number of people attended the meeting, it was fruitful regarding the decision made. All the attendees shared their ideas regarding the new programs.
Following are the summary of the meeting.
– Formally announced WordPress Bhaktapur formation.
– Formed an organizer team for WordPress Bhaktapur.
– Discussion about short term and long term goal.
– Decided upcoming program which will be announced soon in the group.
– And other discussed other minor topics.
WordPress Bhaktapur group will be conducting programs that will directly benefit the people working on WordPress and also helping NGOs through the WordPress.

My upcoming presentation: Javascript templating in WordPress

After a gap of around one and half month again I am going to give my presentation. Last time I had given the presentation on topic “WordPress: Doing Simply & Effectively” at WordPress Pokhara meetup.

This time I will be collaborating with my friend Digambar Pradhan and will be giving the presentation in WordPress Kathmandu meetup on 25th Feb 2017. We are doing it a little bit differently. We are doing a workshop where we will show how Javascript templating is done in WordPress with the demo.
We will show its use on backend and frontend. WordPress has recently released JSON API. We will be showing JS templating with the use of JSON API too. We are hoping that it would be useful for many developers.
Hope we will see you guys in the workshop and after workshop let us know feedback on it.
Check out detail about the event here.

Wanderers – a short film by Erik Wernquist

I actually forgot how I found this short film but its amazing si-fi short film titled “Wanderers” directed by Erik Wernquist, digital artist and animator. Astronomer Carl Sagan has narrated this short film, reading from his book Pale Blue Dot: A Vision of the Human Future in Space.
According to director: The film is a vision of our humanity’s future expansion into the Solar System. Although admittedly speculative, the visuals in the film are all based on scientific ideas and concepts of what our future in space might look like, if it ever happens.

Carl Sagan’s narration concludes as he states:
Maybe it’s a little early. Maybe the time is not quite yet. But those are the worlds, promising untold opportunities, beckon silently. They orbit the sun, waiting.

Music: Timi Ra, Ma

Music has always been my best pal since childhood. There is pure love between me and music. I grew up listening to the songs of Nepali bands like Cobweb, Mongolian heart, Gloomy Guys, Kandara, Nepathya and list goes one. Nepali music industry during that period I think was golden and turning into new way. With the new flavor of music. There were only few artists those time and most of them produce a good music which we still remember and still hear it.
So, that was the past. Now most of the good old band either do not exists or only making few music. New there are lots of band, lots of singer and they have lots of option to reach to the listeners. In past there were very few studios where artist could record songs. Now any kid can record their songs from home and publish it to YouTube or SoundCloud and be the next Bieber.
In the mass of uprising talented singers and musician, its very hard to find good music. May be I am only the person with this difficulty. Since last few year I could only find few number of good music in Nepal. Like from Kandara Band, Karma Band, Bipul Chettri, Astha Tamang Maskey and recently Bartika Eam Rai.
Going Back to title…
I don’t remember the year but must be 2 years back. I was avid user of SoundCloud because I could find old bands music and also creative music. And I also found Raw version (must be) of “Timi Ra, Ma”. Now that version is not in SoundCloud. I could not exactly remember the singer name that time but her writings were great. It was nice song and I listened while working like I used to listen “Maya” by Full circle.
This year, A song was tranding among my friend circle. “Khai” from album “Bimbaakash” by Bartika Eam Rai. I checked the YouTube and wow the song was nice. A song title from the same album caught my eye and it was “Timi Ra, Ma”. I played the song and surprisingly it was same from the SoundCloud few year back.
I went to SoundClound and played all the track from the album. All the songs were awesome. There was something new in each song. Music and lyrics were all fantastic. Specially my favorite “Hawaaijahaaj“. All the songs are not the usual songs we hear in Nepal, they are all unique. I can listen for a long time.
Songs like this shows a new path and hope on Nepali music industry. It will definitely make Nepali music listeners happy. It is better to use the options musicians have today to create a better music and not just for the show off. Now a days I think people are also concious about the good music. So, musician needs to work hard to earn a good credit.
Image credit: Unsplash

SCRIPT_DEBUG constant in WordPress

By default WordPress loads minified version of CSS and JS files so that it would contribute in loading time. As from the user point it is helpful but as for the developer point it might be sometime painful during development. Minified CSS and JS files are very hard to read and understand, so debugging becomes complicated in that case.
In such cases it would be very easy if we could see the unminifed versions of CSS and JS, isn’t it?
Yes, it would be very easy and WordPress have solutions for it.
It is SCRIPT_DEBUG constant.
Just put following line as you define constant WP_DEBUG in wp-config.php file.
define( ‘SCRIPT_DEBUG’, true );
After you put this line in wp-config.php and view page source then you can see the unminified version of the CSS and JS.
That’s a great start, but what about its use in plugin or theme?
Definitely there SCRIPT_DEBUG has its use in plugin or theme. Its better to have minified and unminifed version of CSS and JS in our plugin or theme. We can load our minified version of files using following method.

<?php
function your_plugin_scripts() {
	// if SCRIPT_DEBUG is undefined/ false, use minified libraries
	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
	// Load script.
	wp_enqueue_script( 'plugin-script-handle', plugin_dir_url( __FILE__ ) . 'assets/plugin-script-file' . $suffix . '.js', array( 'jquery' ) );
	// Load style.
	wp_enqueue_style( 'plugin-style-handle', plugin_dir_url( __FILE__ ) . 'assets/css/plugin-style-file' . $suffix . '.css', array() );
}
add_action( 'wp_enqueue_scripts', 'your_plugin_scripts' );

And this would load minified version of you files if SCRIPT_DEBUG is not defined or false.
Hope this small article would be some how helpful to you. Let me know your feedback.

New way of creating music

Technology has influenced almost everything in the world from our daily life to big enterprises to music. In modern days technology is used heavily in the music industry. Technology has given us a new taste in music. Day by day new technology has been introduced that can change the way we create music.
During the final moment of the Intel CES 2016 Keynote, a new device was presented that can make gesture music. A. R. Rahman and his band created music using Intel’s Curie, a button-sized hardware module for wearable devices. Without using any real musical instrument they performed their song “Jai Ho” from Slumdog Millionaire.
Future will tell more about the scope of this device. But it’s a very interesting device for me. Check out the video:

Add JQuery LightBox in WordPress Gallery

Yūjin kon’nichiwa (友人こんにちは) (Hello Friends in Japanese), Today I am going to talk Little about the WordPress Default Gallery and will show you how to get the JQuery Lightbox effect on the WordPress Gallery.
As we all know WordPress Have it’s default Gallery Feature with shortcode. Its a very simple and useful feature given by WordPress. But while using this feature I felt that it would be great if we could add the JQuery lightbox in the Gallery as default gallery links image to its original image or can a be linked to attachment page. For this idea I searched for a useful plugin and I found Pretty Photo Media, that worked perfectly for me. Download and activate the plugin.
This plugin used “rel” attribute. So I used following hook for adding the attribute. Place it in the functions.php of your current theme.

add_filter( 'wp_get_attachment_link', 'theme_prettyadd', 10, 6);
function theme_prettyadd ($content, $id, $size, $permalink, $icon, $text) {
$content = preg_replace("/<a/"," return $content;
}

Now, Insert your gallery in post or page. While inserting gallery one thing you have to check it you need to change Link To In Gallery Settings Option to “Media File”. If you are done with all things then refresh your gallery page and there you are. The gallery is lightbox enabled.
Comment if you have any question or you can also share your view for this post.

Codeigniter remove index.php

Hola Amigos (Hello Friends in Spanish) 🙂 , In this post I am going to show how do we remove index.php in Codeigniter.
While you install fresh Codeigniter your URL is some thing like this:
example.com/index.php/class/function/ID
But this URL structure is not so much charming and is also not much SEO friendly. So we would like to change above URL to something life this:
example.com/class/function/ID
To modify the URL you need to enable mod_rewrite module first, since it’s initially disabled in apache configuration file. Open httpd.conf and search for “mod_rewrite”. If you are a WAMP user like me than to find httpd.conf in your Taskbar click WAMP icon -> Apache->httpd.conf. You will find a line with following text.
#LoadModule rewrite_module modules/mod_rewrite.so #AddModule mod_rewrite.c
Uncomment the lines (remove the trailing #) like this:
LoadModule rewrite_module modules/mod_rewrite.so #AddModule mod_rewrite.c
Than you need to restart the WAMP or whatever server you are using.
Now next step to to create a .htaccess file with following code.

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Now if you remove index.php from you URL then it would perfectly work. In some of the server we will find error showing “No input file specified”. Then we need to just add “?” after index.php and it will solve problem.

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

I hope this small post would help you some how. Happy Coding.
Reference
http://ellislab.com/codeigniter/user-guide/general/urls.html

Parallax Design

This is just a brief research done to gain the knowledge about the Parallax Design and gather the resource to about it. So I have mentioned different site links where I found suitable points. This is not a tutorial and want to help you find the suitable resource about the Parallax Design. Hope it helps.

Parallax…?
Parallax is a displacement or difference in the apparent position of an object viewed along two different lines of sight, and is measured by the angle or semi-angle of inclination between those two lines. (Wikipedia)
And what is Parallax Design?
According to unleashed-technologies.com : Parallax site design is which the background of the website moves at a different speed as the rest of the page for an impressive visual effect that allows for countless creative applications for online storytelling.
(The site also shows trending status, opportunity of use, downside and tips for the parallax design.)
So is Parallax Design a trending subject?
Yes, Google Trends Shows it as a growing trend in the since 2009 and its trending rapidly. Google,Flickr, Puma and other many big and small companies are using this design concept.
What about Compatibility Issues?
According to joshcarllewis.com : If we assume that only those who are using browsers that don’t support or have JavaScript won’t be able to use see any parallax effects, then  according to data from Yahoo that is 2% of average traffic in the US and 1.3% in the UK. While low this number is there and must be kept in mind. If only using the plugins to make some elements more exciting this shouldn’t be a problem as backgrounds will still remain, but sites that make heavy use of jQuery to take the user along a path with popups and animations will suffer badly.
What are requirements for Parallax Design?
According to site: onbile.com : following are the requirements for parallax design:

  • CSS: Containers with relative positions

  • CSS: Using absolute positioning

  • CSS: Using z-index floating objects

  • PNG images with transparent backgrounds

  • Images, using sprites

  • JavaScript to recognize scroll position

How to create a simple parallax effect?
Webdesignerdepot.com Shows the basic example of the parallax design. That simply scrolls the position of the background image with respect to the scroll of the browser content. (Demo)
Themeforest.com uses JQuery to take a horizontally scrolling website and add a parallax scrolling background effect reminiscent of old-school 2D platform games like Sonic the Hedgehog. (Demo)
Webdesignshock.com shows a bit advance way to the parallax design. (Demo)
Is there JQuery Plug-ins for the parallax design?
Yes, there are. Some of them are listed below:

Parallax plugins comparison
The comparison of the parallax plug-ins can be found in Github.com.
Inspirations

WordPress & Parallax Design.
As the WordPress is one of the most popular CMS, application of the parallax design in WordPress is also rapidly growing. Some parallax beautiful themes for WordPress:

Other Resources
Behind The Scenes Of Nike Better World – Smashingmagazine.com
Create a Parallax Scrolling Website Using Stellar.js – Tutsplus.com
Parallaxin’ – Html5rocks.com
Rise of the Parallax Effect – Joshcarllewis.com
Parallax Scrolling and Its Usage in Web Design – Designmodo.com