Tuesday, March 3, 2015

Ubuntu: Install Nemo file manager from PPA again

I love Nemo, but it is a little bit unstable. You can reach a slightly newer version of it from the webupd8team PPAs, so why not?

 sudo add-apt-repository ppa:webupd8team/nemo  
 sudo apt-get update  
 sudo apt-get install nemo nemo-fileroller  

Tuesday, February 3, 2015

Ubuntu: Intel video driver problems with Ubuntu 14.10?

Trying to play a little Miami Hotline in Ubuntu with Steam pointed out that something is wrong with my current setup. I had unexpected video lockups too, I hope updating the Intel video drivers from this source will solve them too. Miami Hotline works flawlessly now, so there is hope :-)

Type this in the terminal to update your intel drivers:

 sudo add-apt-repository ppa:oibaf/graphics-drivers   
 sudo apt-get update  
 sudo apt-get upgrade  

Warning: Performance will be decrease a little bit according to Glmark2, but it will be more stable...

Thursday, January 15, 2015

How to disable youtube related videos

In some cases, the related videos at the end of a youtube video should be hidden, especially if there is a chance that a competitor to your business might appear.

Try it yourself:

With related videos:
https://www.youtube.com/embed/aMqd5EQXD-g

Without related videos:
https://www.youtube.com/embed/aMqd5EQXD-g?rel=0

Saturday, January 10, 2015

Wordpress: How to make pagination work with your custom query

If you build a custom query in Wordpress with Wp_Query(), your pagination with the following basic code might now work:

 <div class="navigation">  
 <div class="next-posts"><?php next_posts_link('&laquo; Older Entries') ?></div>  
      <div class="prev-posts"><?php previous_posts_link('Newer Entries &raquo;') ?></div>  
 </div>  

 When you build your query you have to make sure to use the $wp_query variable as next_posts_link() and previous_posts_link() expect that.

Your query should look like this:

 <?php  
 $args = array(  
 'post_type' => 'post',   
 'posts_per_page' => 10,   
 'paged' => $paged  
 );  
 $wp_query = new WP_Query( $args );  
 ?>  

Friday, January 9, 2015

Sublime Text: PyV8 problem in Ubuntu 14.10 with Emmet

After installing the Emmet plugin, I got error messages that the PyV8 is not working. I tried everything that google provided in search results, but the working solution was utterly shocking...

Although I have a 64bit Ubuntu installed, I had to manually install the 32 bit version of PyV8 from here: https://github.com/emmetio/pyv8-binaries

Sublime Text: Plugins 2015/01

Installed plugins

  • All Autocomplete
    Extends the default autocomplete to find matches in all open files.
  • AutoFileNames
    Autocomplete Filenames in Sublime Text
  • BracketHighlighter
    Bracket Highlighter matches a variety of brackets such as: [], (), {}, "", '', <tag></tag>, and even custom brackets.
  • Color Highlighter
    ColorHighlighter is a plugin for the Sublime Text 2 and 3, which unobtrusively previews hexadecimal color values by underlaying the selected hex codes in different styles and icons. Also, plugin adds color picker, color format converter and less/sass variables navigation to easily modify colors.
  • Colorsublime
    Install/change themes quickly and easily, right from Sublime Text.
  • Emmet
    Emmet is a plugin for many popular text editors which greatly improves HTML & CSS workflow.
  • Package Control
    The Sublime Text package manager that makes it exceedingly simple to find, install and keep packages up-to-date.
  • Package Syncing
    Keep your Sublime Text installations synchronised across multiple machines
  • SideBar Enhancements
    Provides enhancements to the operations on Sidebar of Files and Folders for Sublime Text.
  • Super Calculator
    Super Calculator is a plugin for Sublime Text 2 and Sublime Text 3 which lets you do inline calculations with a few keypresses. This is useful for example to subtract paddings from your widths in your CSS code.
  • TrailingSpaces
    Highlight trailing spaces and delete them in a flash!

Plugins for SASS

  • SASS Build
  • SublimeOnSaveBuild

Themes:

  • Fox
  • Space Grey





Sublime Text: Sync your configuration and packages between multiple machines

When you code from multiple locations and machines, you always aim to have the same development enviroment if possible. Now syncing Sublime Text between multiple machines is as easy as installing a package.

You should start from your already well configured setup and install "Package Syncing" in package control. If you have no idea how to do that, read about it here: https://packagecontrol.io/

To set up the sync, you can use dropbox or any other cloud service. Run "Package Syncing: Define Sync Folder" from the command palette and set the syn directory.

In my case it became /home/tenchi/Dropbox/Apps/SublimeText

On the other machines just make a clean install, set up package control, install the Package Syncing package and set the same path as before (assuming you use the same cloud service and same directories). Restart Sublime Text and it should sync all packages and settings.