Javascript: Chrome is a lot more restrict

Today I ran into an issue where simple javascript would stop running for no apparent reason. I finally traced the problem down to where I was handling the response on a jquery.form callback:   if (response.message instanceof Array) { var html = ""; for (var line in response.message) { html… Continue reading

Kohana: Buffering output on view and rendering it before in the source code

Sometimes you need to hack the order the source code is going to be rendered in a view: – You want an extra piece of CSS that only aplies to that view, so you think it's not worth creating a single CSS file and including in your mashed file –… Continue reading

mysql: Dumping single database table and restoring

Sometimes you need to dump a single table from a mysql table and restore it somewhere else. Here's what you need:   1. Dump the table (compress it so it will take shorter to transfer over the network)   mysqldump -h <HOST> -u <USERNAME> -p <DATABASE> <TABLE> | gzip >… Continue reading

Android: ANDROID_BIN which android unexpected error occured

$ ./create ~/projects/shoppingbuddy com.PortNumber53.ShoppingBuddy ShoppingBuddyAn unexpected error occurred: ANDROID_BIN="${ANDROID_BIN:=$( which android )}" exited with 1 Deleting project…   nano create Change the line: ANDROID_BIN="${ANDROID_BIN:=$( which android )}" to be the absolute path: ANDROID_BIN="/home/mauricio/adt-bundle-linux-x86_64-20130219/sdk/tools/android"    

Raspberry Pi: installing a LAMP server

Let's put the Raspberry Pi to good use:   1. Install Mysql sudo pacman -S mysql 2. Start your server # systemctl start mysqld 3. Secure your mysql installation # /usr/bin/mysql_secure_installation ——————- NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL       SERVERS IN PRODUCTION USE!  PLEASE… Continue reading

Git branch in Mac OSX bash prompt

I tried using the same changes for my linux boxes on my macbook air and they didn't work, so I googled around and stumbled upon using this instead:     c_cyan=`tput setaf 6` c_red=`tput setaf 1` c_green=`tput setaf 2` c_sgr0=`tput sgr0` parse_git_branch (){ if git rev-parse –git-dir >/dev/null 2>&1 then… Continue reading

Kohana: core, adding submodules, customization

After cloning the repository, let's add the Kohana core, a few modules and customize the installation: 1.  git submodule add git://github.com/kohana/core.git modules/system git submodule add git://github.com/kohana/database.git modules/database git submodule add git://github.com/kohana/cache.git modules/cache git submodule add git://github.com/kohana/image.git modules/image git submodule add git://github.com/kohana/pagination.git modules/pagination   2. Initialize the modules   $ git… Continue reading

Facebook: Creating your first APP in PHP

So you finally decided you want to create a Facebook app to make your million dollar idea pay off a million dollars! Great!   Cutting to the chase:   1. Install the Developers App so you can get started creating apps on Facebook. https://developers.facebook.com/ and click Allow 2. Create and… Continue reading

Intranet: Setup a DNSCACHE for your network using DJBDNS

On this tutorial you will learn how to using DJBDNS to setup a DNS cache to help speed up queries for your local network.   I like using Debian, so that is the distribution I'll be using for most of my tutorials. Current version as of this, is Squeeze.  … Continue reading

Git: Prepare your repository – step 1

  Here I’ll explain how you can create a new repository for your projects and use GIT for your version control needs.     For this, I’ll assume everything is already installed (git and stuff). This also assumes you’re using an Operating System and not the Vermont thing.   Replace… Continue reading