GoliatoneNotes for self and beyond.Goodbye Toto, nikko is here.http://goliatone.comGoliatoneRaspberry Pi Nodejs Open Zwaveblog/2015/11/13/raspberry-pi-nodejs-open-zwaveThu Nov 12 2015 19:00:00 GMT-0500 (EST)Thu Nov 12 2015 19:00:00 GMT-0500 (EST)Goliatone
sudo apt-get install make build-esential libudev-dev
mkdir open-wave
wget https://github.com/OpenZWave/open-zwave/archive/master.zip
unzip master.zip
cd open-wave
make && sudo make install
if node-gyp is acting up, just remove and install again.
node...
Javascript Contract Developmentblog/2015/11/13/javascript-contract-developmentThu Nov 12 2015 19:00:00 GMT-0500 (EST)Thu Nov 12 2015 19:00:00 GMT-0500 (EST)Goliatone
JavaScript: Desing by contract.
The javascript console has a little known method: assert.
The idea is that you can place in your development code assertions such as:
Model.prototype.setName = function(name){
console.assert(name);
this.name...
Nodemcu Optimizationsblog/2015/10/17/nodemcu-optimizationsFri Oct 16 2015 20:00:00 GMT-0400 (EDT)Fri Oct 16 2015 20:00:00 GMT-0400 (EDT)Goliatone
Not enough memory
https://github.com/nodemcu/nodemcu-firmware/issues/457
I could explain how to do this but I am not minded to on an issue list about bugs in the firmware. However in short, have you played with lua -i on your dev PC? you type in Lua...
Lua Global Pollutionblog/2015/10/13/lua-global-pollutionMon Oct 12 2015 20:00:00 GMT-0400 (EDT)Mon Oct 12 2015 20:00:00 GMT-0400 (EDT)Goliatone
I've been doing some work with the NodeMCU dev board using Lua, which is a great language. One thing that has been nagging me is that variables and functions are declared in the global namespace by default.
This has been bothering me as I've been...
Sails Query by Relationsblog/2015/10/11/sails-query-by-relationsSat Oct 10 2015 20:00:00 GMT-0400 (EDT)Sat Oct 10 2015 20:00:00 GMT-0400 (EDT)Goliatone
If you need to query a model by properties on a related model:
Mac Os Node Not a Directory Errorblog/2015/09/29/mac-os-node-not-a-directory-errorMon Sep 28 2015 20:00:00 GMT-0400 (EDT)Mon Sep 28 2015 20:00:00 GMT-0400 (EDT)Goliatone
env: node\r: Not a directory
npm install -g slack-cli
slackcli
env: node\r: No such file or directory
The fix looks like
brew install dos2unix
find /usr/local/lib/node_modules/slack-cli -name "*.js" | xargs sudo dos2unix
slackcli --help
Git Fails After Upgrading Mac Osblog/2015/09/23/git-fails-after-upgrading-mac-osTue Sep 22 2015 20:00:00 GMT-0400 (EDT)Tue Sep 22 2015 20:00:00 GMT-0400 (EDT)Goliatone
After upgrading Mac OS git would fail with the following error:
Nodemcu Pir Motion Detectorblog/2015/09/19/nodemcu-pir-motion-detectorFri Sep 18 2015 20:00:00 GMT-0400 (EDT)Fri Sep 18 2015 20:00:00 GMT-0400 (EDT)Goliatone
The PIR would read garbage, totally random values. The issue is that although the logic is 3.3v it has to be powered with at least 5v.
The trickiest part was to figure out how to power the PIR from a NodeMCU which only has 3.3v
Turns out some PIR...
Nodemcu Button Mqtt Exampleblog/2015/09/08/nodemcu-button-mqtt-exampleMon Sep 07 2015 20:00:00 GMT-0400 (EDT)Mon Sep 07 2015 20:00:00 GMT-0400 (EDT)GoliatoneOmnikey 5427 Mac Osxblog/2015/09/04/omnikey-5427-mac-osxThu Sep 03 2015 20:00:00 GMT-0400 (EDT)Thu Sep 03 2015 20:00:00 GMT-0400 (EDT)Goliatone
The HID OMNIKEY 5427 CK is a PC/SC (CCID) compliant SmartCard...
Raspberry Pi Force Sensitive Resistorblog/2015/08/12/raspberry-pi-force-sensitive-resistorTue Aug 11 2015 20:00:00 GMT-0400 (EDT)Tue Aug 11 2015 20:00:00 GMT-0400 (EDT)Goliatone
https://acaird.github.io/computers/2015/01/07/raspberry-pi-fsr/ https://learn.adafruit.com/reading-a-analog-in-and-controlling-audio-volume-with-the-raspberry-pi/connecting-the-cobbler-to-a-mcp3008
Raspberry Pi Pir Motion Python Nodejsblog/2015/08/12/raspberry-pi-pir-motion-python-nodejsTue Aug 11 2015 20:00:00 GMT-0400 (EDT)Tue Aug 11 2015 20:00:00 GMT-0400 (EDT)Goliatone
Wiring: GND -> 39
D01 -> GPIO21 #40
V -> 5v #2
picture
npm i --save johnny-five raspi-io
python:
Arduino Yun Install Pipblog/2015/08/01/arduino-yun-install-pipFri Jul 31 2015 20:00:00 GMT-0400 (EDT)Fri Jul 31 2015 20:00:00 GMT-0400 (EDT)Goliatone
If you want to install pip on the Yún, you can follow this commands:
The first thing you need to do is update the package manager.
From here, we just follow the normal steps to install pip using easy_install
We need to install python's openssl...
Python Amqp 406 Precondition Failed Auto Deleteblog/2015/07/25/python-amqp-406-precondition-failed-auto-deleteFri Jul 24 2015 20:00:00 GMT-0400 (EDT)Fri Jul 24 2015 20:00:00 GMT-0400 (EDT)Goliatone
tutorial 5
pika.exceptions.ChannelClosed: (406, "PRECONDITION_FAILED - inequivalent arg 'auto_delete' for exchange 'wework.dev' in vhost 'ivgdeswq': received 'false' but current is 'true'")
The fix is just a configuration paramter:
Routing...
Aws Dynamodb Gotchasblog/2015/07/24/aws-dynamodb-gotchasThu Jul 23 2015 20:00:00 GMT-0400 (EDT)Thu Jul 23 2015 20:00:00 GMT-0400 (EDT)Goliatone
Things to consider:
Item size:
Cannot exceed 400 KB which includes both attribute name binary length (UTF-8 length) and attribute value lengths (again binary length). The attribute name counts towards the size limit. For example, consider an item...
Nodejs Waterline Error Cannot Read Property Identity of Undefinedblog/2015/07/03/nodejs-waterline-error-cannot-read-property-identity-of-undefinedThu Jul 02 2015 20:00:00 GMT-0400 (EDT)Thu Jul 02 2015 20:00:00 GMT-0400 (EDT)Goliatone
While working with [waterline] I kept getting the following error:
Cannot read property 'identity' of undefined
It took me a bit to figure it out, but it turns out the problem was on the identity definition. After some fiddling around it turned out...
Golang Change Template Delimitersblog/2015/06/28/golang-change-template-delimitersSat Jun 27 2015 20:00:00 GMT-0400 (EDT)Sat Jun 27 2015 20:00:00 GMT-0400 (EDT)Goliatone
The html/template package uses {{ and }} as default delimiters, which might conflict with any front end template logic that you might have on a served html.
To fix this, you can change the value of the delimiters.
Golang Go Install Cli Toolsblog/2015/06/27/golang-go-install-cli-toolsFri Jun 26 2015 20:00:00 GMT-0400 (EDT)Fri Jun 26 2015 20:00:00 GMT-0400 (EDT)Goliatone
TL;DR If you install a package's binary with go install and you can't access the executable command from terminal, make sure that your go workspace's bin subdirectory is added to the $PATH.
Nodejs Cluster Dockerblog/2015/06/26/nodejs-cluster-dockerThu Jun 25 2015 20:00:00 GMT-0400 (EDT)Thu Jun 25 2015 20:00:00 GMT-0400 (EDT)Goliatone
NOPE:...
Node Setimmediate vs Process Nexttickblog/2015/06/18/node-setimmediate-vs-process-nexttickWed Jun 17 2015 20:00:00 GMT-0400 (EDT)Wed Jun 17 2015 20:00:00 GMT-0400 (EDT)Goliatone
The names of this two are counter intuitive since their behavior seems backwards. setImmediate is executed after nextTick.
You might have used before a setTimeout with a time of 0 for instance to postpone emitting an event. setImmediate and nextTick...
Arduino Yun Node Evacuation Allocation Failed Process out of Memoryblog/2015/06/13/arduino-yun-node-evacuation-allocation-failed-process-out-of-memoryFri Jun 12 2015 20:00:00 GMT-0400 (EDT)Fri Jun 12 2015 20:00:00 GMT-0400 (EDT)Goliatone
If you are working with an Arduino Yún trying to npm install a package and you get the following error:
Evacuation Allocation failed - process out of memory
You can disable the memory settings for node editing the file /usr/bin/node:
However, it...
Nano Error Opening Terminal Xterm256colorblog/2015/06/12/nano-error-opening-terminal-xterm256colorThu Jun 11 2015 20:00:00 GMT-0400 (EDT)Thu Jun 11 2015 20:00:00 GMT-0400 (EDT)Goliatone
If you like to use nano and get this error:
Error opening terminal: xterm-256color unknown terminal type
Here is a quick fix:
Once you are in nano just type the commands again, exit and save.
Thats it.
Mac Osx Brew Install Versions of Psqlblog/2015/05/24/mac-osx-brew-install-versions-of-psqlSat May 23 2015 20:00:00 GMT-0400 (EDT)Sat May 23 2015 20:00:00 GMT-0400 (EDT)Goliatone
To install and manage multiple Postgres versions on mac using brew, you can top tinto this repo:
https://github.com/petere/homebrew-postgresql
Then, you can brew install as needed.
The formulae installed are "keg-only", meaning that they are not...
Leap Motion Brickedblog/2015/05/08/leap-motion-brickedThu May 07 2015 20:00:00 GMT-0400 (EDT)Thu May 07 2015 20:00:00 GMT-0400 (EDT)Goliatone
I've had a leap motion for a while now, and recently a project surged for which the Leap would be perfect.
Had not played with it for a bit, so when I opened the controller it asked to upgrade the firmware. After that the Leap motion stopped to...
Raspberry Pi Node Gyp Issuesblog/2015/05/08/raspberry-pi-node-gyp-issuesThu May 07 2015 20:00:00 GMT-0400 (EDT)Thu May 07 2015 20:00:00 GMT-0400 (EDT)Goliatone
I was having issues with node-gyp. I had to reinstall it
One thing I noticed while doing the upgrade is that node was also upgraded, I had manually installed node_0.10.36-1_armhf.deb and it got upgraded to v0.12.0.
Enable the Serial Port in the...
Python Running Multiple Environmentsblog/2015/05/08/python-running-multiple-environmentsThu May 07 2015 20:00:00 GMT-0400 (EDT)Thu May 07 2015 20:00:00 GMT-0400 (EDT)Goliatone
pip install virtualenv
virtualenv myapp
cd myapp
source bin/activate
which python3
/usr/local/bin/python3
virtualenv -p /usr/local/bin/python3
openssl s_client -connect 192.168.0.1:443 -CAfile python -c 'import requests...
Raspberry Pi Set up Enable Ssh Loginblog/2015/04/29/raspberry-pi-set-up-enable-ssh-loginTue Apr 28 2015 20:00:00 GMT-0400 (EDT)Tue Apr 28 2015 20:00:00 GMT-0400 (EDT)Goliatone
cd ~
mkdir ~/.ssh
cat keys.txt > authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
Edit the ssh config file /etc/ssh/sshd_config
sudo nano /etc/ssh/sshd_config
Somewhere in this file (usually on page 2 – CTRL+V for next page)...
Raspberry Pi Setup from Imageblog/2015/04/27/raspberry-pi-setup-from-imageSun Apr 26 2015 20:00:00 GMT-0400 (EDT)Sun Apr 26 2015 20:00:00 GMT-0400 (EDT)Goliatone
./flash --ssid WeWorkCopr --password Cr3@t0r$ ../DISTROS/2015-02-16-raspbian-wheezy.zip
mdkir CODE
Ssh Warning Remote Host Identification Has Changedblog/2015/04/27/ssh-warning-remote-host-identification-has-changedSun Apr 26 2015 20:00:00 GMT-0400 (EDT)Sun Apr 26 2015 20:00:00 GMT-0400 (EDT)Goliatone
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be...
Raspberry Pi Autoconnect to Wifiblog/2015/04/10/raspberry-pi-autoconnect-to-wifiThu Apr 09 2015 20:00:00 GMT-0400 (EDT)Thu Apr 09 2015 20:00:00 GMT-0400 (EDT)Goliatone
wpa-roam does this exactly.
https://www.raspberrypi.org/forums/viewtopic.php?t=11517
http://weworkweplay.com/play/automatically-connect-a-raspberry-pi-to-a-wifi-network/
Raspberry Pi Build Your Own Wheeze Imgblog/2015/04/10/raspberry-pi-build-your-own-wheeze-imgThu Apr 09 2015 20:00:00 GMT-0400 (EDT)Thu Apr 09 2015 20:00:00 GMT-0400 (EDT)Goliatone
Resources...
Raspberrypi Dockerblog/2015/04/06/raspberrypi-dockerSun Apr 05 2015 20:00:00 GMT-0400 (EDT)Sun Apr 05 2015 20:00:00 GMT-0400 (EDT)Goliatone
./flash --hostname freshpi --ssid vitaminag --password camchacka ~/Downloads/hypriot-rpi-20150329-140334.img.zip
Python Parse Boolean Values with Argparseblog/2015/04/04/python-parse-boolean-values-with-argparseFri Apr 03 2015 20:00:00 GMT-0400 (EDT)Fri Apr 03 2015 20:00:00 GMT-0400 (EDT)Goliatone
I was writing a small python script which was using argparse to handle command line arguments.
Raspberry Pi Init D Script Node Appblog/2015/04/01/raspberry-pi-init-d-script-node-appTue Mar 31 2015 20:00:00 GMT-0400 (EDT)Tue Mar 31 2015 20:00:00 GMT-0400 (EDT)Goliatone
Once you have developed an app that you want to run on your Raspberry Pi you need to find a way to have it running on the background and possibly to start on boot.
There are different ways to go about it, but a simple and effective one is to use...
Raspberry Ip Mac Address Trackingblog/2015/03/28/raspberry-ip-mac-address-trackingFri Mar 27 2015 20:00:00 GMT-0400 (EDT)Fri Mar 27 2015 20:00:00 GMT-0400 (EDT)Goliatone
First, you need to find the MAC address of the device you want to track. If you have an iPhone you can find it under Settings > General > About > Wi-Fi Address.
Git Serve Local Repo to Lanblog/2015/03/27/git-serve-local-repo-to-lanThu Mar 26 2015 20:00:00 GMT-0400 (EDT)Thu Mar 26 2015 20:00:00 GMT-0400 (EDT)Goliatone
Sometimes you don't want to create a remote repository. Or your remote is down. For whatever reason, you might want to serve a repo over your local network without too much trouble. Note that is an insecure way of sharing a repo.
One way of doing...
Raspberry Pi Assign Local Domainblog/2015/03/27/raspberry-pi-assign-local-domainThu Mar 26 2015 20:00:00 GMT-0400 (EDT)Thu Mar 26 2015 20:00:00 GMT-0400 (EDT)Goliatone
Instead of accessing a Raspberry Pi by it's IP address I find it easier to assign it a .local domain.
I work on a Mac which comes with Bonjour. On the Raspberry Pi I use Avahi.
Fist update your pi:
Installing Avahi is as simple as typing the...
Vagrant Raspberry Pi Workflowblog/2015/03/26/vagrant-raspberry-pi-workflowWed Mar 25 2015 20:00:00 GMT-0400 (EDT)Wed Mar 25 2015 20:00:00 GMT-0400 (EDT)Goliatone
Workflow: Use Vagrant to manage the state of the image on your dev box
Use qemu-img to convert the vmdk to an img file
Flash that to the SD card
Vagrant file
Reads:
Why port Docker to the Raspberry Pi?
Docker
Running...
S3 Serve Static Websiteblog/2015/03/26/s3-serve-static-websiteWed Mar 25 2015 20:00:00 GMT-0400 (EDT)Wed Mar 25 2015 20:00:00 GMT-0400 (EDT)Goliatone
Setup You can use S3 to host a static Website using a regular bucket.
Create a bucket and give it a sensible name- domain of your site. Select the region where you want to create the Bucket.
You can then upload all static assets from your...
Arduino Yun Web Serverblog/2015/03/23/arduino-yun-web-serverSun Mar 22 2015 20:00:00 GMT-0400 (EDT)Sun Mar 22 2015 20:00:00 GMT-0400 (EDT)Goliatone
The cool thing about the Yún is that it comes with a built in web server.
NOTE:
At this point, you should know how to connect to your Yún using WiFi and through your server. Also, you should have expanded its memory. [LINK TO PREVIOUS POSTS]
An...
Nano Arduino Yunblog/2015/03/23/nano-arduino-yunSun Mar 22 2015 20:00:00 GMT-0400 (EDT)Sun Mar 22 2015 20:00:00 GMT-0400 (EDT)Goliatone
Yes, I prefer nano over vi.
If you try to use nano on your Arduino Yún you might get the following error:
Error opening terminal: xterm-256color.
To get rid of that error, type this command into terminal:
This change would only last for the current...
Setting up Nodejs Arduino Yunblog/2015/03/23/setting-up-nodejs-arduino-yunSun Mar 22 2015 20:00:00 GMT-0400 (EDT)Sun Mar 22 2015 20:00:00 GMT-0400 (EDT)Goliatone
The Arduino Yún runs a Linux distribution based on OpenWrt named OpenWrt-Yun.
It actually runs an ATmega32u4 microcontroller and a Atheros AR9331 processor.
To connect via SSH, you need the IP address of the Yún, the admin password. The computer...
Raspberrypi Installing Nodeblog/2015/03/22/raspberrypi-installing-nodeSat Mar 21 2015 20:00:00 GMT-0400 (EDT)Sat Mar 21 2015 20:00:00 GMT-0400 (EDT)Goliatone
To install node in the raspberry pi, you can use the deb packages distributed by the node-arm app, which is an open source express app hosted on heroku. Source code available on github.
At the time of writing this, there were four build...
Raspberrypi Installing Ngrokblog/2015/03/22/raspberrypi-installing-ngrokSat Mar 21 2015 20:00:00 GMT-0400 (EDT)Sat Mar 21 2015 20:00:00 GMT-0400 (EDT)Goliatone
ngrok is an amazing service. This is how is described in their website:
Introspected tunnels to localhost
"I want to securely expose a local web server to the internet and capture all traffic for detailed inspection and replay."
And that is exactly...
Javascript Marked Play Nice with Highlightjsblog/2015/03/21/javascript-marked-play-nice-with-highlightjsFri Mar 20 2015 20:00:00 GMT-0400 (EDT)Fri Mar 20 2015 20:00:00 GMT-0400 (EDT)Goliatone
TLDR; You need to use the langPrefix option to include hljs class.
Let me start by saying that marked is awesome.
However, if you want to use highlightjs with marked you might run into the issue of your tags not having a proper background.
That is...
Javascript Momentjs Deprecation Warning Moment Constructor Fall Back to Js Dateblog/2015/03/20/javascript-momentjs-deprecation-warning-moment-constructor-fall-back-to-js-dateThu Mar 19 2015 20:00:00 GMT-0400 (EDT)Thu Mar 19 2015 20:00:00 GMT-0400 (EDT)Goliatone
Moment: Deprecation warning: moment constructor fall back to js Date
Working with moment.js in node I kept getting the following deprecation warning:
Deprecation warning: moment construction falls back to js Date. This is discouraged and will be...
Arduino Forbids Comparison Between Pointer and Integer Errorblog/2015/03/20/arduino-forbids-comparison-between-pointer-and-integer-errorThu Mar 19 2015 20:00:00 GMT-0400 (EDT)Thu Mar 19 2015 20:00:00 GMT-0400 (EDT)Goliatone
Arduino: ISO C++ forbids comparison between pointer and integer
Following a simple hello world example for the Arduino Yún got me for a second. The error output was the following:
The code for getTimeStamp is as simple as this:
This time around...
Arduino Forbids Chartingblog/2015/03/20/arduino-forbids-chartingThu Mar 19 2015 20:00:00 GMT-0400 (EDT)Thu Mar 19 2015 20:00:00 GMT-0400 (EDT)Goliatone
Arduino: ISO C++ forbids comparison between pointer and integer
Following a simple hello world example for the Arduino Yún got me for a second. The error output was the following:
The code for getTimeStamp is as simple as this:
This time around...
Javascript Deprecation Warning Moment Constructor Fall Back to Js Dateblog/2015/03/20/javascript-deprecation-warning-moment-constructor-fall-back-to-js-dateThu Mar 19 2015 20:00:00 GMT-0400 (EDT)Thu Mar 19 2015 20:00:00 GMT-0400 (EDT)Goliatone
Moment: Deprecation warning: moment constructor fall back to js Date
Working with moment.js in node I kept getting the following deprecation warning:
Deprecation warning: moment construction falls back to js Date. This is discouraged and will be...
Note to Self Slakr User Tokenblog/2015/03/13/note-to-self-slakr-user-tokenThu Mar 12 2015 20:00:00 GMT-0400 (EDT)Thu Mar 12 2015 20:00:00 GMT-0400 (EDT)Goliatone
Slakr To get a user token go to:
https://api.slack.com/web
Open Source Alternatives to Twilioblog/2015/03/12/open-source-alternatives-to-twilioWed Mar 11 2015 20:00:00 GMT-0400 (EDT)Wed Mar 11 2015 20:00:00 GMT-0400 (EDT)Goliatone
Open Source alternatives to Twilio
Twilio is an excellent product. I've used it in some projects with high performance demands where reliability was critical and I could not been happier.
However, is always good to have alternatives, and more so if...
Python Fata Error No Such File or Directory Python Hblog/2015/03/09/python-fata-error-no-such-file-or-directory-python-hSun Mar 08 2015 20:00:00 GMT-0400 (EDT)Sun Mar 08 2015 20:00:00 GMT-0400 (EDT)Goliatone
Solve Fatal Error: Python.h No such file or directory
While installing zeroconf, pip failed with the following error:
netifaces.c:1:20: fatal error: Python.h: No such file or directory
To solve it, install python dev:
If apt-get fails to find the...
Mac Terminal Batch Rename Filesblog/2015/03/06/mac-terminal-batch-rename-filesThu Mar 05 2015 19:00:00 GMT-0500 (EST)Thu Mar 05 2015 19:00:00 GMT-0500 (EST)Goliatone
Batch rename files from terminal
A one liner to batch change file extensions from terminal. In this example we are graving all files with a txt extension in the current directory and updating the files with a md extension:
Raspberry Pi Bonjourblog/2015/03/06/raspberry-pi-bonjourThu Mar 05 2015 19:00:00 GMT-0500 (EST)Thu Mar 05 2015 19:00:00 GMT-0500 (EST)Goliatone
Raspberry pi bonjour
Using avahi-daemon:
On mac terminal:
Configuring avahi-daemon
Now wouldn’t it be nice if the Mac showed your Pi under the shared section of the Finder sidebar? For this the Raspberry Pi needs to be advertising itself on the...
Mac Capture Ip Mac in Lanblog/2015/03/05/mac-capture-ip-mac-in-lanWed Mar 04 2015 19:00:00 GMT-0500 (EST)Wed Mar 04 2015 19:00:00 GMT-0500 (EST)Goliatone
!--
http://www.fresymetal.com/como-detectar-intrusos-en-tu-wifi-con-raspberry-pi/
--
Raspberry Pi Wifi Monitorblog/2015/03/05/raspberry-pi-wifi-monitorWed Mar 04 2015 19:00:00 GMT-0500 (EST)Wed Mar 04 2015 19:00:00 GMT-0500 (EST)Goliatone
Raspberry pi wifi monitor
I was trying to use the raspberry pi to monitor traffic on my LAN using the Wi
Fi dongle that came with the raspberry pi, a realtek- RTL8188CUS. It does not work.
Typing iwconfig on terminal:
Looking around, I found this...
Raspberry Pi Command Not Foundblog/2015/03/05/raspberry-pi-command-not-foundWed Mar 04 2015 19:00:00 GMT-0500 (EST)Wed Mar 04 2015 19:00:00 GMT-0500 (EST)Goliatone
Raspberry Pi: command not found
I was trying to use a BLE dongle with a raspberry pi, and got this error:
command-not-found
There is a package command-not-found that provides help.
After you install it, you need to update the database:
sudo...
Raspberrypi Sudo Node Command Not Foundblog/2015/02/27/raspberrypi-sudo-node-command-not-foundThu Feb 26 2015 19:00:00 GMT-0500 (EST)Thu Feb 26 2015 19:00:00 GMT-0500 (EST)Goliatone
/opt/node/bin/node
lrwxrwxrwx 1 pi root 26 Jan 18 01:57 /opt/node -> node-v0.10.28-linux-arm-pi
/usr/bin/node
lrwxrwxrwx 1 root root 18 Mar 1 01:47 /usr/bin/node ->...
Raspberrypi Unicorn Hatblog/2015/02/25/raspberrypi-unicorn-hatTue Feb 24 2015 19:00:00 GMT-0500 (EST)Tue Feb 24 2015 19:00:00 GMT-0500 (EST)Goliatone
Unicorn Hat
Not working:
Includes 40 pin GPIO ribbon cable
Power supply
You can use rpi-ws281x-native
Note to Self Generate Timestampsblog/2015/02/13/note-to-self-generate-timestampsThu Feb 12 2015 19:00:00 GMT-0500 (EST)Thu Feb 12 2015 19:00:00 GMT-0500 (EST)Goliatone
Generate UNIX timestamps
JavaScript:
Java:
Python:
Ruby:
Erlang:
PHP:
MySQL:
Note to Self Python Remove Duplicated Dicts from Listblog/2015/02/13/note-to-self-python-remove-duplicated-dicts-from-listThu Feb 12 2015 19:00:00 GMT-0500 (EST)Thu Feb 12 2015 19:00:00 GMT-0500 (EST)Goliatone
Python: Remove duplicate dicts from list
You have a list of dicts and want to remove duplicates. You can use a list comprehension:
If you open the python rpl:
Raspberrypi Ftpsync Sublimetextblog/2015/02/11/raspberrypi-ftpsync-sublimetextTue Feb 10 2015 19:00:00 GMT-0500 (EST)Tue Feb 10 2015 19:00:00 GMT-0500 (EST)Goliatone
Remote edit files in raspberrypi
To work in your computer and sync files to the raspberry pi you can use the package FTPSync, repo here
Your config file should look similar to this one:
Setup FTP in raspberry pi
We can use a simple FTP server, vsftp...
Raspberry Pi Python Install Pipblog/2015/01/24/raspberry-pi-python-install-pipFri Jan 23 2015 19:00:00 GMT-0500 (EST)Fri Jan 23 2015 19:00:00 GMT-0500 (EST)Goliatone
How to install pip on raspberry pi
One way to install pip on your raspberry pi:
Setup tools include easy_install, which you can use to install pip:
If you have multiple versions of Python- or are running Python 3- then use the specific easy_install...
Raspberry Pi Setupblog/2015/01/21/raspberry-pi-setupTue Jan 20 2015 19:00:00 GMT-0500 (EST)Tue Jan 20 2015 19:00:00 GMT-0500 (EST)Goliatone
raspberry pi
remove wolfram
install node:
Install cmake:
Installing raspicam:
Download from SourceForge
tar xvzf raspicam-0.1.1.zip
cd raspicam-0.1.1
mkdir build
cd build
cmake ..
Output should be something in the lines of:
If you had opencv...
Python Opencv Mac Osblog/2015/01/19/python-opencv-mac-osSun Jan 18 2015 19:00:00 GMT-0500 (EST)Sun Jan 18 2015 19:00:00 GMT-0500 (EST)Goliatone
Python openCV on Mac OS
Install openCV with brew:
After brew is done installing you might get this warning:
==> Caveats
Python modules have been installed and Homebrew's site-packages is not
in your Python sys.path, so you will not be able to...
Nodejs Sudo Npm Command Not Foundblog/2015/01/16/nodejs-sudo-npm-command-not-foundThu Jan 15 2015 19:00:00 GMT-0500 (EST)Thu Jan 15 2015 19:00:00 GMT-0500 (EST)Goliatone
sudo npm command not found
Use which npm:
Npm Postinstall Scriptblog/2015/01/03/npm-postinstall-scriptFri Jan 02 2015 19:00:00 GMT-0500 (EST)Fri Jan 02 2015 19:00:00 GMT-0500 (EST)Goliatone
NPM package.json: postinstall script
A feature I did not know about npm is the ability to run post install scripts.
Here is a list of all the suported script tags:
prepublish: Run BEFORE the package is published. (Also run on local npm install...
Mac how to Make Icnsblog/2014/12/25/mac-how-to-make-icnsWed Dec 24 2014 19:00:00 GMT-0500 (EST)Wed Dec 24 2014 19:00:00 GMT-0500 (EST)Goliatone
Make icns from Iconset:
Node Upgrading Socket Io 0 9 1 Xblog/2014/12/24/node-upgrading-socket-io-0-9-1-xTue Dec 23 2014 19:00:00 GMT-0500 (EST)Tue Dec 23 2014 19:00:00 GMT-0500 (EST)Goliatone
Upgrading socket.io from 0.9 to 1.x
You can follow the [migration docs][migration-docs] at socket.io's website.
Since io.set is gone, in my case, on the server app I had to convert form this:
to this:
Logging is now based on debug, so to print only...
Node Growl Mochablog/2014/12/15/node-growl-mochaSun Dec 14 2014 19:00:00 GMT-0500 (EST)Sun Dec 14 2014 19:00:00 GMT-0500 (EST)Goliatone
Run growl with mocha tests, MacOS
mocha is a great testing framework.
It has a flag to use growl notifications. The command to run using the watch feature and growl:
This way you are supposed to be able to run the tests on the background and get...
Python Help Built in Functionblog/2014/11/26/python-help-built-in-functionTue Nov 25 2014 19:00:00 GMT-0500 (EST)Tue Nov 25 2014 19:00:00 GMT-0500 (EST)Goliatone
Python "help" function
Python has many built-in functions globally available. I'm sure most are familiar with dict, int, str, or even zip.
Today I came across the help function:
help([object])
Invoke the built-in help system. (This function is...
Node Current Working Directoryblog/2014/11/14/node-current-working-directoryThu Nov 13 2014 19:00:00 GMT-0500 (EST)Thu Nov 13 2014 19:00:00 GMT-0500 (EST)Goliatone
Get current working directory from CLI script
To get the directory from which your command tool/script has been called you can use the cwd method of the global object process:
Ios Core Data the Model Used to Open Store Incompatible One Create the Storeblog/2014/11/03/ios-core-data-the-model-used-to-open-store-incompatible-one-create-the-storeSun Nov 02 2014 19:00:00 GMT-0500 (EST)Sun Nov 02 2014 19:00:00 GMT-0500 (EST)Goliatone
NSCocoaErrorDomain Code: 134100
During development, this error can appear while adding pre populated data in a new project or after modifying entities in a CoreData model.
The model used to open the store is incompatible with the one used to create...
Xcode 6 Empty Application Goneblog/2014/10/22/xcode-6-empty-application-goneTue Oct 21 2014 20:00:00 GMT-0400 (EDT)Tue Oct 21 2014 20:00:00 GMT-0400 (EDT)Goliatone
Xcode 6 removed Empty Application
As a workaround, you can add the old templates. Download files from here. Then place the directory inside the Xcode app- right click Xcode and select Show Package...
Git Rename Local Branch Update Remoteblog/2014/10/22/git-rename-local-branch-update-remoteTue Oct 21 2014 20:00:00 GMT-0400 (EDT)Tue Oct 21 2014 20:00:00 GMT-0400 (EDT)Goliatone
Rename git branch local and origin
Rename a branch locally, we then delete the old branch, and push the new branch to origin, setting the local one to track remote.
Objective C Retain Cycleblog/2014/10/21/objective-c-retain-cycleMon Oct 20 2014 20:00:00 GMT-0400 (EDT)Mon Oct 20 2014 20:00:00 GMT-0400 (EDT)Goliatone
Objective-C: Retain cycle
Objects in a hierarchy are created, owned and freed in a chain along the hierarchy.
In its most simple form, a retain cycle occurs when two objects keep a strong reference to each other since both objects do retain each...
Mac Osx Simple Webview Applicationblog/2014/10/21/mac-osx-simple-webview-applicationMon Oct 20 2014 20:00:00 GMT-0400 (EDT)Mon Oct 20 2014 20:00:00 GMT-0400 (EDT)Goliatone
Simple Mac OSX application with WebView
Create a new project in Xcode:
Select OS X > Application > Cocoa Application
After you have created the project, select the app delegate header file.
Add WebKit framework
Go to target settings, General tab...
Mac Osx Terminal Copy Paste Commandsblog/2014/10/19/mac-osx-terminal-copy-paste-commandsSat Oct 18 2014 20:00:00 GMT-0400 (EDT)Sat Oct 18 2014 20:00:00 GMT-0400 (EDT)Goliatone
Mac OSX: Copy to clipboard terminal command
To copy the contents of a file to the clipboard is pretty straight forward on a Mac terminal:
To paste the contents of the clipboard into a file:
Wolf Cms Content Not Found 404blog/2014/10/17/wolf-cms-content-not-found-404Thu Oct 16 2014 20:00:00 GMT-0400 (EDT)Thu Oct 16 2014 20:00:00 GMT-0400 (EDT)Goliatone
Wolf CMS 404 Error page
I have a legacy website that runs on the Wolf CMS. I got an email from the owner informing me that suddenly the website was unaccessible and rendering the following error message:
Apparently, Wolf CMS shows the reported error...
Ffmpg Convert Gif to Mp4blog/2014/10/09/ffmpg-convert-gif-to-mp4Wed Oct 08 2014 20:00:00 GMT-0400 (EDT)Wed Oct 08 2014 20:00:00 GMT-0400 (EDT)Goliatone
FFmpeg: Convert gif to mp4.
There is a guide on the FFMpeg trac site that describes how to create a video from a sequence of images.
One command extracted from that guide:
Another command:
Sass Compass Grunt Errorblog/2014/10/08/sass-compass-grunt-errorTue Oct 07 2014 20:00:00 GMT-0400 (EDT)Tue Oct 07 2014 20:00:00 GMT-0400 (EDT)Goliatone
Compass Error: require cannot load such file.
Running a compass grunt task that had been working fine, suddenly started failing with the following error:
It turns out that the main error is due to an incompatible sass and compass versions- I had...
Functional Notesblog/2014/09/18/functional-notesWed Sep 17 2014 20:00:00 GMT-0400 (EDT)Wed Sep 17 2014 20:00:00 GMT-0400 (EDT)Goliatone
Purity and Referential transparency
Push side effects to the outer layers of the program. Architect code with a pure core and a thin layer on the outside handling effects.
A pure function is a function without side effects. Referential transparency...
Bash Terminal Pipe Status Commandblog/2014/09/16/bash-terminal-pipe-status-commandMon Sep 15 2014 20:00:00 GMT-0400 (EDT)Mon Sep 15 2014 20:00:00 GMT-0400 (EDT)Goliatone
Exit status
REDO!!!
If you execute a bunch of piped commands, and somewhere in the line a process fails, bash reports that the pipeline executed without errors because bash only reports the status of the last process.
To get the status of every...
Temporarily Overwrite Instance Methodblog/2014/09/13/temporarily-overwrite-instance-methodFri Sep 12 2014 20:00:00 GMT-0400 (EDT)Fri Sep 12 2014 20:00:00 GMT-0400 (EDT)Goliatone
Temporarily overwrite instance method
We can overwrite the prototype method with our custom greet method.
When we are done, we can delete the instance's method so that the prototype methods get used instead.
Grunt Warning Error Template Lodashblog/2014/08/29/grunt-warning-error-template-lodashThu Aug 28 2014 20:00:00 GMT-0400 (EDT)Thu Aug 28 2014 20:00:00 GMT-0400 (EDT)Goliatone
Grunt: Error processing template, lodash barks:
After cloning a repo in a new machine, I kept getting this error when running grunt:
Warning: An error occurred while processing a template (_ is not defined). Use --force to continue.
It was a little...
Javascript Dynamically Create Arraysblog/2014/08/20/javascript-dynamically-create-arraysTue Aug 19 2014 20:00:00 GMT-0400 (EDT)Tue Aug 19 2014 20:00:00 GMT-0400 (EDT)Goliatone
Dynamically create Arrays to iterate
var a = new Array(10);
a[0] // returns undefined
a.length // returns 10, because of reasons.
The following example will NOT put anything to the console, because creating an array with length initialization will...
Javascript Wtfsblog/2014/08/20/javascript-wtfsTue Aug 19 2014 20:00:00 GMT-0400 (EDT)Tue Aug 19 2014 20:00:00 GMT-0400 (EDT)Goliatone
JavaScript Where WTF is 0...
The equality operator translates to this:
Scala Play Cors No Access Control Allow Originblog/2014/08/17/scala-play-cors-no-access-control-allow-originSat Aug 16 2014 20:00:00 GMT-0400 (EDT)Sat Aug 16 2014 20:00:00 GMT-0400 (EDT)Goliatone
Play for Scala: CORS error
Trying to implement a CORs filter to handle GET and POST requests kept failing. The error returned on each POST:
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3003'...
Javascript Dynamically Array One Linerblog/2014/08/13/javascript-dynamically-array-one-linerTue Aug 12 2014 20:00:00 GMT-0400 (EDT)Tue Aug 12 2014 20:00:00 GMT-0400 (EDT)Goliatone
JavaScript: Dynamically create and populate array in one line
Ractivejs Template in Line Argumentsblog/2014/08/11/ractivejs-template-in-line-argumentsSun Aug 10 2014 20:00:00 GMT-0400 (EDT)Sun Aug 10 2014 20:00:00 GMT-0400 (EDT)Goliatone
Ractive.js: Component keys
Component
passing data to instance using template in-line arguments lower cases the keys.
It turns out this is because you're using a for the template and not a tag: http://jsfiddle.net/tzxesca7/2/.
Websocket Closeevent Reason Lengthblog/2014/07/28/websocket-closeevent-reason-lengthSun Jul 27 2014 20:00:00 GMT-0400 (EDT)Sun Jul 27 2014 20:00:00 GMT-0400 (EDT)Goliatone
WebSocket: reason argument
Per the w3 TR:
If reason is longer than 123 bytes, then throw a SyntaxError exception and abort these steps.
Good to know if you are implementing a WebSocket server.
Note to Self Sublime Text File Multi Viewblog/2014/07/27/note-to-self-sublime-text-file-multi-viewSat Jul 26 2014 20:00:00 GMT-0400 (EDT)Sat Jul 26 2014 20:00:00 GMT-0400 (EDT)Goliatone
Note to self: Sublime file multi view
To view the same file on multiple tabs, from the File menu:
File > New View into File
Note to Self Mac Os Terminal Find Process by Port Numberblog/2014/07/22/note-to-self-mac-os-terminal-find-process-by-port-numberMon Jul 21 2014 20:00:00 GMT-0400 (EDT)Mon Jul 21 2014 20:00:00 GMT-0400 (EDT)Goliatone
Find process listening to an specific port number (Mac)
This has happens often enough to be a problem but not often enough for me to remember the command.
If you need to find the process listening to an specific port number, and then kill it, you...
Forcing Schema to the Front Endblog/2014/07/10/forcing-schema-to-the-front-endWed Jul 09 2014 20:00:00 GMT-0400 (EDT)Wed Jul 09 2014 20:00:00 GMT-0400 (EDT)Goliatone
Forcing the schema onto the front end
By using a schema less Platform, we are forcing the job to the front end.
There is a logical point in which it will brake.
JavaScript has many strengths, but type safeness is not one of them.
Basically, we are...
Awsblog/2014/07/08/awsMon Jul 07 2014 20:00:00 GMT-0400 (EDT)Mon Jul 07 2014 20:00:00 GMT-0400 (EDT)Goliatone
Amazon Web Services
Amazon's JavaScript SDK ships with default support for DynamoDB, S3, SNS, SQS, Kinesis, CloudWatch, and STS.
Amazon Kinesis
One common use of Amazon Kinesis is real-time aggregation of data to be then consumed into a data...
Javascript Hate It Aws Sdkblog/2014/07/08/javascript-hate-it-aws-sdkMon Jul 07 2014 20:00:00 GMT-0400 (EDT)Mon Jul 07 2014 20:00:00 GMT-0400 (EDT)Goliatone
JavaScript: Love it or Hate it
I love JavaScript because I can do whatever I want with it.
I have JavaScript because you can do whatever you want it it.
Hate
Everybody can use it. Most developers miss use it.
Here, example from AWS JavaScript SDK:
Git Compare File Between Branchesblog/2014/07/03/git-compare-file-between-branchesWed Jul 02 2014 20:00:00 GMT-0400 (EDT)Wed Jul 02 2014 20:00:00 GMT-0400 (EDT)Goliatone
Git: compare file between branches
If you need to compare a file between two branches
Javascript Check Rangeblog/2014/06/22/javascript-check-rangeSat Jun 21 2014 20:00:00 GMT-0400 (EDT)Sat Jun 21 2014 20:00:00 GMT-0400 (EDT)Goliatone
Check number falls in range
Nodejs Sailsjs Foreverblog/2014/06/21/nodejs-sailsjs-foreverFri Jun 20 2014 20:00:00 GMT-0400 (EDT)Fri Jun 20 2014 20:00:00 GMT-0400 (EDT)Goliatone
Run sails with forever.
Install forever:
Assuming you already have sails installed and have created an app, cd to the root directory of your app.
Add a .foreverignore, using nano:
List files to be ignored by forever on relaod:
NOTE: If you...
Javascript Tilde Shortcut Indexof Checkblog/2014/06/17/javascript-tilde-shortcut-indexof-checkMon Jun 16 2014 20:00:00 GMT-0400 (EDT)Mon Jun 16 2014 20:00:00 GMT-0400 (EDT)Goliatone
Bitwise NOT operator or tilde shortcut:
You can use Array.prototype.indexOf to check the position of an item in an array. If an item is found it returns the index of the item, if the item is not found it returns -1.
The bitwise NOT operator will...
Swift Range Operatorsblog/2014/06/11/swift-range-operatorsTue Jun 10 2014 20:00:00 GMT-0400 (EDT)Tue Jun 10 2014 20:00:00 GMT-0400 (EDT)Goliatone
Swift: Range operators
Swift includes two range operators, two dots, three dots.
The closed range operator (a...b) defines a range that runs from a to b, and includes the values a and b.
The half-closed range operator (a..b) defines a range that runs...
Ractivejs Lifecycleblog/2014/06/11/ractivejs-lifecycleTue Jun 10 2014 20:00:00 GMT-0400 (EDT)Tue Jun 10 2014 20:00:00 GMT-0400 (EDT)Goliatone
Ractive: Life cycle
Ractive 0.4.0:
A teardown event will be fired before the component is removed from the DOM.
```javascript
var ractive = new Component({
init:function(){
this.on('teardown', function(){});
...
Ractivejs Componentsblog/2014/06/10/ractivejs-componentsMon Jun 09 2014 20:00:00 GMT-0400 (EDT)Mon Jun 09 2014 20:00:00 GMT-0400 (EDT)Goliatone
Ractive: Components
This does not work:
This seems to work:
Ffmpeg Gistsblog/2014/06/09/ffmpeg-gistsSun Jun 08 2014 20:00:00 GMT-0400 (EDT)Sun Jun 08 2014 20:00:00 GMT-0400 (EDT)Goliatone
ffmpeg: Convert mov to mp4
Convert from mov to mp4:
ffmpeg -i movie.mov -vcodec copy -acodec copy output.mp4
To do compression:
ffmpeg -i input.mp4 -vcodec libx264 -crf 20 output.mp4
Calculate the bitrate you need by dividing 1 GB by the video...
Mac Osx Reset Admin Passwordblog/2014/05/03/mac-osx-reset-admin-passwordFri May 02 2014 20:00:00 GMT-0400 (EDT)Fri May 02 2014 20:00:00 GMT-0400 (EDT)Goliatone
MacOSX: Reset admin password
Let's say that someone gained access to your computer and changed your main user's password as a prank. You notice when can't sudo and when you type in your old password, it does not work.
Sadly, its actually really easy...
Note to Self Css Ids Cant Start with Numberblog/2014/04/27/note-to-self-css-ids-cant-start-with-numberSat Apr 26 2014 20:00:00 GMT-0400 (EDT)Sat Apr 26 2014 20:00:00 GMT-0400 (EDT)Goliatone
Note to self: CSS id's can not start with a number
Using an id that starts with a number break CSS. ID or classes are not allowed to start with a number.
In CSS2, identifiers (including element names, classes, and IDs in selectors) can contain only...
Mac Osx Find Files by Sizeblog/2014/04/15/mac-osx-find-files-by-sizeMon Apr 14 2014 20:00:00 GMT-0400 (EDT)Mon Apr 14 2014 20:00:00 GMT-0400 (EDT)Goliatone
Mac: How to find files by size in terminal
Piped with other commands:
File size
To see the size of files:
Size switch
Mac Osx Slow Finder Mavericks Beach Ball Partyblog/2014/04/12/mac-osx-slow-finder-mavericks-beach-ball-partyFri Apr 11 2014 20:00:00 GMT-0400 (EDT)Fri Apr 11 2014 20:00:00 GMT-0400 (EDT)Goliatone
Mavericks: Slow Finder
So, I recently bought two new MacPros, both came with Mavericks. Finder has been acting up, being extremely sluggish, and beach balling all the time.
Checking the console app, I saw tons of this messages:
XPC error messaging...
Note to Self Terminal Batch Renameblog/2014/04/10/note-to-self-terminal-batch-renameWed Apr 09 2014 20:00:00 GMT-0400 (EDT)Wed Apr 09 2014 20:00:00 GMT-0400 (EDT)Goliatone
MacOS X: Terminal, batch rename files:
Simple onliner to batch rename files by extension.
Or using sed:
On OSX you may encounter sed: 1: "...": invalid command code.
It seems that -i option expects a file extension. You can pass an empty string as...
Self Note Mac Osx Enable Quicklook Selectblog/2014/04/09/self-note-mac-osx-enable-quicklook-selectTue Apr 08 2014 20:00:00 GMT-0400 (EDT)Tue Apr 08 2014 20:00:00 GMT-0400 (EDT)Goliatone
MacOSX: Enable quicklook text selection:
In order to select text from a preview, enable this in terminal:
Grunt Php Spawn Enoent Errorblog/2014/04/06/grunt-php-spawn-enoent-errorSat Apr 05 2014 20:00:00 GMT-0400 (EDT)Sat Apr 05 2014 20:00:00 GMT-0400 (EDT)Goliatone
Grunt Error: Fatal error: spawn ENOENT
I just switched computers, moving projects slowly to the new one as I've been working on them.
I started working again in a front end project that uses Grunt to manage work-flow and the tool-chain. The peculiar...
Karma Aborted Due Warnings Phantomjsblog/2014/04/01/karma-aborted-due-warnings-phantomjsMon Mar 31 2014 20:00:00 GMT-0400 (EDT)Mon Mar 31 2014 20:00:00 GMT-0400 (EDT)Goliatone
Karma: Aborted due warnings unhelpful error
I really enjoy testing with karma. However, there is something that drives me nuts about it:
Aborted due to warnings.
Could there be anything more fucking unhelpful?
It took me a while to figure out...
Git List Branches Ordered Recent Commitblog/2014/03/10/git-list-branches-ordered-recent-commitSun Mar 09 2014 20:00:00 GMT-0400 (EDT)Sun Mar 09 2014 20:00:00 GMT-0400 (EDT)Goliatone
Git Git, list all branches ordered by recent commit:
Javascript Repeat a String N Timesblog/2014/03/06/javascript-repeat-a-string-n-timesWed Mar 05 2014 19:00:00 GMT-0500 (EST)Wed Mar 05 2014 19:00:00 GMT-0500 (EST)Goliatone
JavaScript: Repeat a string n times.
This is one of those things that you know how to do in one language, say Python, and you find yourself wanting to use in another language, say JavaScript.
So, there is how you can achieve this in JavaScript:
Nodejs Express Autodiscover Routesblog/2014/03/03/nodejs-express-autodiscover-routesSun Mar 02 2014 19:00:00 GMT-0500 (EST)Sun Mar 02 2014 19:00:00 GMT-0500 (EST)Goliatone
Node: Autodiscover routes
In your server.js file:
Then, your route files would look like this:
Mysql Error 1449 the User Specified as a Definer Does Not Existblog/2014/02/27/mysql-error-1449-the-user-specified-as-a-definer-does-not-existWed Feb 26 2014 19:00:00 GMT-0500 (EST)Wed Feb 26 2014 19:00:00 GMT-0500 (EST)Goliatone
Mysql Error #1449
1449 - The user specified as a definer ('username'@'%') does not exist
Basically, MySQL is wining about the user that created a procedure is now undefined. It could have been deleted or it could be that you copied a mysql_dump and...
Javascript Regexp Match Content Between Html Commentsblog/2014/02/14/javascript-regexp-match-content-between-html-commentsThu Feb 13 2014 19:00:00 GMT-0500 (EST)Thu Feb 13 2014 19:00:00 GMT-0500 (EST)Goliatone
JavaScript: RegExp to match content between HTML comments.
I'm sure you are familiar with the following quote:
Some people, when confronted with a problem, think
“I know, I'll use regular expressions.” Now they have two problems.
And, if you...
Grunt Karma Requireblog/2014/02/13/grunt-karma-requireWed Feb 12 2014 19:00:00 GMT-0500 (EST)Wed Feb 12 2014 19:00:00 GMT-0500 (EST)Goliatone
Karma, require, dependencies path issue
If you get a similar error message:
Running "karma:unit" (karma) task
ERROR: 'There is no timestamp for /base/app/js/services/platformclient.js!'
It probably means that the file is not available in the...
Grunt Cli Errorblog/2014/02/12/grunt-cli-errorTue Feb 11 2014 19:00:00 GMT-0500 (EST)Tue Feb 11 2014 19:00:00 GMT-0500 (EST)Goliatone
Grunt: How to get rid of the grunt warning:
Local Npm module "grunt-cli" not found. Is it installed?
I solved that annoying error message by moving grunt-cli from the devDependencies to peerDependencies.
Node Get Rid of Npm Sudoblog/2014/02/12/node-get-rid-of-npm-sudoTue Feb 11 2014 19:00:00 GMT-0500 (EST)Tue Feb 11 2014 19:00:00 GMT-0500 (EST)Goliatone
NPM: Requires sudo to install
If npm requires you to sudo to install, then you should reclaim ownership of npm:
You also need to reclaim your local library:
Vagrant Vbox Power Off Multiple Machinesblog/2014/02/09/vagrant-vbox-power-off-multiple-machinesSat Feb 08 2014 19:00:00 GMT-0500 (EST)Sat Feb 08 2014 19:00:00 GMT-0500 (EST)Goliatone
Alias to power of multiple VBox:
https://github.com/joshmcarthur/vagrant-list
Mac Osx Terminal Compare Directories with Diffblog/2014/02/03/mac-osx-terminal-compare-directories-with-diffSun Feb 02 2014 19:00:00 GMT-0500 (EST)Sun Feb 02 2014 19:00:00 GMT-0500 (EST)Goliatone
Use diff to compare directories
We can use diff to compare two directories in terminal.
To make it recursive, use the -r option:
To get less verbose output, use -q option:
I also find it useful to pipe the output to a text file:
Vagrant List Available Network Interfacesblog/2014/02/03/vagrant-list-available-network-interfacesSun Feb 02 2014 19:00:00 GMT-0500 (EST)Sun Feb 02 2014 19:00:00 GMT-0500 (EST)Goliatone
On boot:
Compass Sass Errorblog/2014/02/02/compass-sass-errorSat Feb 01 2014 19:00:00 GMT-0500 (EST)Sat Feb 01 2014 19:00:00 GMT-0500 (EST)Goliatone
# For some reason, compass seems to be pulling a broken version of sass.
Php Session Safari Bugblog/2014/01/31/php-session-safari-bugThu Jan 30 2014 19:00:00 GMT-0500 (EST)Thu Jan 30 2014 19:00:00 GMT-0500 (EST)Goliatone
PHP session empty on Safari.
The simptom, blank page on some Safari browsers, working as expected on Chrome and FFox.
I had this issue on a simple php application, after the login page
Mac Osx Enable Json Previewblog/2014/01/29/mac-osx-enable-json-previewTue Jan 28 2014 19:00:00 GMT-0500 (EST)Tue Jan 28 2014 19:00:00 GMT-0500 (EST)Goliatone
Enable json preview
https://github.com/rjregenold/jsonlook
Mac Osx Markdown Previewblog/2014/01/28/mac-osx-markdown-previewMon Jan 27 2014 19:00:00 GMT-0500 (EST)Mon Jan 27 2014 19:00:00 GMT-0500 (EST)Goliatone
Enable Markdown preview in MacOs
One thing that has been annoying me lately is the lack of file preview for Markdown files in MacOs.
There is an open source project, qlmarkdown that brings d to QuickLook,
Get the binaries here, the latest release is...
Php Self Referencing Closuresblog/2014/01/25/php-self-referencing-closuresFri Jan 24 2014 19:00:00 GMT-0500 (EST)Fri Jan 24 2014 19:00:00 GMT-0500 (EST)Goliatone
PHP self referencing closures
In order to make closure recursive calls, we need to pass a reference to self.
If you don't pass $parser by reference, it will be null which is it's value at the time you pass it.
Is Not a Bug Its a Featureblog/2014/01/23/is-not-a-bug-its-a-featureWed Jan 22 2014 19:00:00 GMT-0500 (EST)Wed Jan 22 2014 19:00:00 GMT-0500 (EST)Goliatone
It's not a bug, it's a feature
So, I don't remember when was the first time I ever heard that phrase. I always felt that it was meant to be a cheap developer excuse and I just left it at that.
Let me tell you a little history.
I got thrown into a...
Mac Osx Private Var Vm Sleepimageblog/2014/01/22/mac-osx-private-var-vm-sleepimageTue Jan 21 2014 19:00:00 GMT-0500 (EST)Tue Jan 21 2014 19:00:00 GMT-0500 (EST)Goliatone
Mac OS: Reclaim disk space
So, I've been having issues with my MacPro. It has a new SSD hard drive but from time to time, it will start swapping and claim there is no more disk space left on the computer.
I started looking for large files:
The...
Mac Osx Brew 404 Error Git Local Changesblog/2014/01/18/mac-osx-brew-404-error-git-local-changesFri Jan 17 2014 19:00:00 GMT-0500 (EST)Fri Jan 17 2014 19:00:00 GMT-0500 (EST)Goliatone
Brew herrors:
While doing a brew search I got this output on the terminal:
Apparently, that means that you need to brew update.
Aparently, a local file got modified and broke the repo.
TODO: how does brew store/manage formulas?
A quick fix would...
Git Move Directory from Repo to New Repo with Historyblog/2014/01/18/git-move-directory-from-repo-to-new-repo-with-historyFri Jan 17 2014 19:00:00 GMT-0500 (EST)Fri Jan 17 2014 19:00:00 GMT-0500 (EST)Goliatone
Move a directory from a git repository to its own repository, with history
You can use filter-branch
To rewrite the repository to look as if foodir/ had been its project root, and discard all other history:
Note to Self Mac Os Terminal Word Countblog/2014/01/18/note-to-self-mac-os-terminal-word-countFri Jan 17 2014 19:00:00 GMT-0500 (EST)Fri Jan 17 2014 19:00:00 GMT-0500 (EST)Goliatone
Count the number of lines, words, and characters of a text file, mac.
wc will give you counts for print newline, word, and byte for a specified file.
You can see the explainshell entry here, wc explained.
w: words
c: characters
Total number of...
The Hardest Bugsblog/2014/01/17/the-hardest-bugsThu Jan 16 2014 19:00:00 GMT-0500 (EST)Thu Jan 16 2014 19:00:00 GMT-0500 (EST)Goliatone
Thougtest BUGs
Thinking about bugs, I can think of three buckets to classify them.
Implicit acceptance that base conditions are ok: The bug is in the language that you are using, PHP, MySQL*
Panic induced: Late night deployment, you are tired. You...
Php String Templateblog/2014/01/14/php-string-templateMon Jan 13 2014 19:00:00 GMT-0500 (EST)Mon Jan 13 2014 19:00:00 GMT-0500 (EST)Goliatone
PHP simple string template method
A rather simplistic function to interpolate strings and replace tokens by the values found in a provided context.
Consider the following example:
Vagrant Chown Silently Failsblog/2014/01/12/vagrant-chown-silently-failsSat Jan 11 2014 19:00:00 GMT-0500 (EST)Sat Jan 11 2014 19:00:00 GMT-0500 (EST)Goliatone
Vagrant fails to change file permissions in synced folder
Setting up a LAMP Vagrant sandbox, I kept running on different issues that boiled down to this:
I could change/set permissions for files and directories outside the vagrant synced folder, and...
Pro Tip Alternative Assignmentblog/2014/01/08/pro-tip-alternative-assignmentTue Jan 07 2014 19:00:00 GMT-0500 (EST)Tue Jan 07 2014 19:00:00 GMT-0500 (EST)Goliatone
PHP Alternative assignment
In JavaScript you can use the following sintax:
In PHP 5.3 the equivalent syntax would be a imaginative use of the ternary operator.
If you want to use the logical or operator, || you would have to take a roundabout.
Php Echo vs Printblog/2014/01/07/php-echo-vs-printMon Jan 06 2014 19:00:00 GMT-0500 (EST)Mon Jan 06 2014 19:00:00 GMT-0500 (EST)Goliatone
PHP: Difference between echo and print
Going over some PHP code I noticed that echo and print were being used [almost] interchangeably.
Print takes only one parameter
Another difference is that while echo can take multiple parameters, print only...
Sublime Text Execute Php Scriptsblog/2014/01/02/sublime-text-execute-php-scriptsWed Jan 01 2014 19:00:00 GMT-0500 (EST)Wed Jan 01 2014 19:00:00 GMT-0500 (EST)Goliatone
How to execute PHP from SBT
If you want to quickly test your PHP scripts from within Sublime Text you have to add a build file.
Go to Tools > Build System > New Build System
That should bring a new file, you should place the following inside:
In my...
Javascript Remove Console Statementsblog/2013/12/31/javascript-remove-console-statementsMon Dec 30 2013 19:00:00 GMT-0500 (EST)Mon Dec 30 2013 19:00:00 GMT-0500 (EST)Goliatone
JavaScript: Remove console statements
There are a few tools to remove console statements on your production code.
groundskeeper or grunt-remove-logging both let you remove console.* statements, or specify a patter to match your own logger...
Article Todo Mvc 2 Hmvcpblog/2013/12/31/article-todo-mvc-2-hmvcpMon Dec 30 2013 19:00:00 GMT-0500 (EST)Mon Dec 30 2013 19:00:00 GMT-0500 (EST)Goliatone
TODO: Rewrite the code in this article mvc-with-js to refactor it and express a simpler way of doing things.
MVC is a design pattern that breaks an application in three layers:
Model: Handling data (Model).
View: Presentating data to the...
Note to Self Mysql Create Userblog/2013/12/27/note-to-self-mysql-create-userThu Dec 26 2013 19:00:00 GMT-0500 (EST)Thu Dec 26 2013 19:00:00 GMT-0500 (EST)Goliatone
MySQL: Create user
Quick note, create user in MySQL CLI:
Login into mysql:
If you need to delete a user:
To revoke permissions:
Test new user:
Login again with the new user:
User permissions:
CREATE Create new tables or databases
DROP Delete...
Apache Redirect Domain to Localhost Portblog/2013/12/26/apache-redirect-domain-to-localhost-portWed Dec 25 2013 19:00:00 GMT-0500 (EST)Wed Dec 25 2013 19:00:00 GMT-0500 (EST)Goliatone
Apache: Redirect domain to localhost port
When setting up a local development environment, sometimes you mihgt want to forward a domain to any app running on localhost:port a connection. For instance, if you are using Vagrant.
Note to Self Apache Install Moduleblog/2013/12/26/note-to-self-apache-install-moduleWed Dec 25 2013 19:00:00 GMT-0500 (EST)Wed Dec 25 2013 19:00:00 GMT-0500 (EST)Goliatone
Activate module in apache
To activate the module:
Then, restart apache:
Rant Personas the Inmates Are Running the Asylumblog/2013/12/25/rant-personas-the-inmates-are-running-the-asylumTue Dec 24 2013 19:00:00 GMT-0500 (EST)Tue Dec 24 2013 19:00:00 GMT-0500 (EST)Goliatone
Personas http://alanklement.blogspot.com/2013/03/focus-on-relationships-skip-personas.html
Been reading the book The Inmates are Running the Asylum, by Alan Cooper.
They are made up and not real. This means they are full of errors and prejudice.
Pro Tip Serialize Properties Cache Idblog/2013/12/24/pro-tip-serialize-properties-cache-idMon Dec 23 2013 19:00:00 GMT-0500 (EST)Mon Dec 23 2013 19:00:00 GMT-0500 (EST)Goliatone
Serialize object properties as key for cache
Simple idea, how to invalidate cache? Simple pattern would be to have the sate
of the object reflected in its cache id. Serialize its properties and values
as the id.
Pro Tip Naming Conventionsblog/2013/12/24/pro-tip-naming-conventionsMon Dec 23 2013 19:00:00 GMT-0500 (EST)Mon Dec 23 2013 19:00:00 GMT-0500 (EST)Goliatone
Naming conventions as fat burner.
I like to follow conventions, specially naming conventions. They are a good thing. No need to be as radical as Rails, but to a degree that is not a hidrance and it's easier to figure out the conventions rather than...
Pro Tip Hierarchical Configurationblog/2013/12/24/pro-tip-hierarchical-configurationMon Dec 23 2013 19:00:00 GMT-0500 (EST)Mon Dec 23 2013 19:00:00 GMT-0500 (EST)Goliatone
Configuration strategy
It's nice to have a configuration strategy in place where you can cascade overrides at different levels, where options specified in the lower level are overriden by the ones closer to the user.
gconfig, TODO: MAKE PHP...
Pro Tip Event Dependenciesblog/2013/12/24/pro-tip-event-dependenciesMon Dec 23 2013 19:00:00 GMT-0500 (EST)Mon Dec 23 2013 19:00:00 GMT-0500 (EST)Goliatone
Simple interface to prevent event dependencies
Oftentimes I hear that event introduce dependencies in your code. It's somehow true.
A simple patter I use, have a method that returns system wide event name dependencies, and a hub method to handle all...
Php Static Factoryblog/2013/12/22/php-static-factorySat Dec 21 2013 19:00:00 GMT-0500 (EST)Sat Dec 21 2013 19:00:00 GMT-0500 (EST)Goliatone
PHP: Inherited factory method
In PHP, you can use the keyword static inside a factory method to get a reference to the current class at runtime- as opposed to self that would return the original class in which the method was originally defined.
This...
Run Php in Grunt Projectblog/2013/12/18/run-php-in-grunt-projectTue Dec 17 2013 19:00:00 GMT-0500 (EST)Tue Dec 17 2013 19:00:00 GMT-0500 (EST)Goliatone
Execute PHP in a Grunt based web project
I do some fair amount of work in PHP, and
gateway
connect-modrewrite
Php Array Filter by Keyblog/2013/12/16/php-array-filter-by-keySun Dec 15 2013 19:00:00 GMT-0500 (EST)Sun Dec 15 2013 19:00:00 GMT-0500 (EST)Goliatone
How to filter arrays in PHP by key
Assuming we have an array with keys we want to retrieve from $_REQUEST
What would be the best way to filter $_REQUEST based on $allowed keys?
The simplest would be to use:
Other implementations
One solution would...
Git Numeric Versionblog/2013/12/09/git-numeric-versionSun Dec 08 2013 19:00:00 GMT-0500 (EST)Sun Dec 08 2013 19:00:00 GMT-0500 (EST)GoliatoneNote to Self Django Jquery Namespaceblog/2013/12/08/note-to-self-django-jquery-namespaceSat Dec 07 2013 19:00:00 GMT-0500 (EST)Sat Dec 07 2013 19:00:00 GMT-0500 (EST)Goliatone
Note to self
Django: undefined jQuery
Django loads jQuery as a dependency and stores it under the django namespace.
To access the jQuery loaded by django you would use django.jQuery.
Using a module pattern to define a module that has jQuery as a...
Note to Self Python Double Underscores Nameblog/2013/11/25/note-to-self-python-double-underscores-nameSun Nov 24 2013 19:00:00 GMT-0500 (EST)Sun Nov 24 2013 19:00:00 GMT-0500 (EST)Goliatone
Note to self
Python: Whats the conventional name for double underscores
Python is riddled with tons of magic words, reserved for the core developers.
There is a suggested shorthand for those awkward names: dunder for Double UNDERscore.
You can read a...
Javascript Object Hasownpropertyblog/2013/11/18/javascript-object-hasownpropertySun Nov 17 2013 19:00:00 GMT-0500 (EST)Sun Nov 17 2013 19:00:00 GMT-0500 (EST)Goliatone
JavaScript: Object.hasOwnProperty
A coworker asked me today about JavaScript Object's hasOwnProperty method, and how do I use it.
I figured I would just
Jquery Check if Selector Nullblog/2013/11/18/jquery-check-if-selector-nullSun Nov 17 2013 19:00:00 GMT-0500 (EST)Sun Nov 17 2013 19:00:00 GMT-0500 (EST)Goliatone
jQuery: Handy selector null check
In jQuery, if you want to check if a selector exists or not you could check the length property, or use the size method.
However, by extending the fn with a simple method we can get some nice flow.
Then, we can use...
Note to Self Requirejs Jquery Bootstrapblog/2013/11/16/note-to-self-requirejs-jquery-bootstrapFri Nov 15 2013 19:00:00 GMT-0500 (EST)Fri Nov 15 2013 19:00:00 GMT-0500 (EST)Goliatone
Note to self
RequireJS, jQuery and Twitter Bootstrap
If you want to use Twitter Bootstrap with require, you need to declare jQuery as a dependency for bootstrap.
The following setup uses the CDN script of both jQuery and bootstrap and provide a local...
Javascript Get Object Typeblog/2013/11/06/javascript-get-object-typeTue Nov 05 2013 19:00:00 GMT-0500 (EST)Tue Nov 05 2013 19:00:00 GMT-0500 (EST)Goliatone
Object.prototype.toString( )
When the toString method is called, the following steps are taken:
Get the [[Class]] property of this object.
Compute a string value by concatenating the three strings “[object ", Result (1), and "]“.
Return Result...
Note to Self Enable Cors Htaccessblog/2013/11/04/note-to-self-enable-cors-htaccessSun Nov 03 2013 19:00:00 GMT-0500 (EST)Sun Nov 03 2013 19:00:00 GMT-0500 (EST)Goliatone
Note to self
Enable CORS in htaccess
Ajax crossdoamin issues, or the following error on any ajax request:
Origin is not allowed by Access-Control-Allow-Origin
If the Product Is Free You Are the Productblog/2013/10/31/if-the-product-is-free-you-are-the-productWed Oct 30 2013 20:00:00 GMT-0400 (EDT)Wed Oct 30 2013 20:00:00 GMT-0400 (EDT)Goliatone
If the product is free, you are the product.
Just saying. Nothing more
Sublime 3 Markdown Reference Links Plugin Exampleblog/2013/10/31/sublime-3-markdown-reference-links-plugin-exampleWed Oct 30 2013 20:00:00 GMT-0400 (EDT)Wed Oct 30 2013 20:00:00 GMT-0400 (EDT)Goliatone
Simple Sublime Text 3 plugin example
Note to Self Mac Osx Create File of Sizeblog/2013/10/25/note-to-self-mac-osx-create-file-of-sizeThu Oct 24 2013 20:00:00 GMT-0400 (EDT)Thu Oct 24 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
Create file of size
Sometimes, I need a file of a certain size to test something out. Turns out there is a simple utility you can use from terminal.
Note to Self Mac Os Terminal Run Last Commandblog/2013/10/25/note-to-self-mac-os-terminal-run-last-commandThu Oct 24 2013 20:00:00 GMT-0400 (EDT)Thu Oct 24 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
Run last command
Simple shortcut that stands in place of your previously written command:
Yup, that's it. This is useful after having typed a long command, we find out it needed root privileges.
To enter the last command again but with...
Node Find if Script Is Required or Invoked from Cliblog/2013/10/23/node-find-if-script-is-required-or-invoked-from-cliTue Oct 22 2013 20:00:00 GMT-0400 (EDT)Tue Oct 22 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
Node: Find if script is required or invoked from CLI
Analogous to python's if __name__ == '__main__': in node you can test if a file is being directly invoked from CLI as follows:
Php Phpunit Error Seleniumtestcaseblog/2013/10/22/php-phpunit-error-seleniumtestcaseMon Oct 21 2013 20:00:00 GMT-0400 (EDT)Mon Oct 21 2013 20:00:00 GMT-0400 (EDT)Goliatone
PHPUnit Error: SeleniumTestCase
From time to time I keep seeing this error when I try to run PHPUnit. I always seem to be able to fix it, and forget abut it.
So, note to self:
If you can't run PHPUnit, and you get error/warnings that look like the...
Python Wsgi Script Does Not Contain Applicationblog/2013/10/13/python-wsgi-script-does-not-contain-applicationSat Oct 12 2013 20:00:00 GMT-0400 (EDT)Sat Oct 12 2013 20:00:00 GMT-0400 (EDT)Goliatone
Target WSGI script 'x' does not contain WSGI application 'application'
Well, believe it or not, the error is what the message reads. You literally need to have a method/var named application for WSGI to be happy.
Note that mod_wsgi requires that the...
Timidity Mac Brewblog/2013/10/12/timidity-mac-brewFri Oct 11 2013 20:00:00 GMT-0400 (EDT)Fri Oct 11 2013 20:00:00 GMT-0400 (EDT)Goliatone
Timidity: Download TiMidity++ GUI from here
Download instruments, and install.
touch /usr/local/share/timidity/timidity.cfg
Django Update Admin App Labelsblog/2013/10/07/django-update-admin-app-labelsSun Oct 06 2013 20:00:00 GMT-0400 (EDT)Sun Oct 06 2013 20:00:00 GMT-0400 (EDT)Goliatone
Django: Customize app labels.
If you want to change the label displayed in the admin CMS, and do a quick google, the questions seem to get rather bizard questions. Like, override templatetags, etc.
The hard way
python
The easy way
Use django's...
Django Admin Override User Panelblog/2013/10/07/django-admin-override-user-panelSun Oct 06 2013 20:00:00 GMT-0400 (EDT)Sun Oct 06 2013 20:00:00 GMT-0400 (EDT)Goliatone
Remove Permissions panel from Django user admin panel.
Sometimes it can be a little bit tricky to figure out how to customize your django admin setup.
I had one very specific task:
Remove the Permissions panel from the Django user admin panel.
The...
Note to Self Python Unpack Kwargs Into Attributesblog/2013/10/06/note-to-self-python-unpack-kwargs-into-attributesSat Oct 05 2013 20:00:00 GMT-0400 (EDT)Sat Oct 05 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
Python: Unpack **kwargs into properties
I'm lazy. I want to be able to take any named arguments in my constructor call and make properties.
Instead of doing this:
Python Get vs Getattr vs Getattributeblog/2013/10/06/python-get-vs-getattr-vs-getattributeSat Oct 05 2013 20:00:00 GMT-0400 (EDT)Sat Oct 05 2013 20:00:00 GMT-0400 (EDT)Goliatone
Python: get vs getattr vs getattribute
__getattr__ is [only] invoked if the attribute is not defined in the instance and it was not found.
__getattribute__ is invoked before looking for the attribute in the object instance. It has precedence over...
Packer Vagrant Build Vmblog/2013/10/02/packer-vagrant-build-vmTue Oct 01 2013 20:00:00 GMT-0400 (EDT)Tue Oct 01 2013 20:00:00 GMT-0400 (EDT)Goliatone
Archive SRC repo
git archive -o nuskin-cms.zip HEAD
#
PACKER_LOG=1 packer build --only=virtualbox CG-RAA-packer-virtualbox-testing-2.json
vagrant box add whateveryouwantittobe packer_virtualbox_virtualbox.box
Python Loveblog/2013/09/30/python-loveSun Sep 29 2013 20:00:00 GMT-0400 (EDT)Sun Sep 29 2013 20:00:00 GMT-0400 (EDT)Goliatone
Python and love.
taken from here
Note to Self Django List Models Appblog/2013/09/29/note-to-self-django-list-models-appSat Sep 28 2013 20:00:00 GMT-0400 (EDT)Sat Sep 28 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
Django: list all models in app:
A quick snippet to list all models declared in a Django app.
Nodejs Express Multiple View Enginesblog/2013/09/28/nodejs-express-multiple-view-enginesFri Sep 27 2013 20:00:00 GMT-0400 (EDT)Fri Sep 27 2013 20:00:00 GMT-0400 (EDT)Goliatone
Node.js: Multiple templating engines simultaneously in express.
I will start by saying that I am not a big fan of haml or jade. While I understand why some developers might and do enjoy them I prefer something more moustachesque
In the case you want...
Note to Self Python Globblog/2013/09/27/note-to-self-python-globThu Sep 26 2013 20:00:00 GMT-0400 (EDT)Thu Sep 26 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
Count files in directory
Count files in directory
Note to Self Python Merge Dictsblog/2013/09/27/note-to-self-python-merge-dictsThu Sep 26 2013 20:00:00 GMT-0400 (EDT)Thu Sep 26 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
#
Note to Self Speed up Terminal Openblog/2013/09/24/note-to-self-speed-up-terminal-openMon Sep 23 2013 20:00:00 GMT-0400 (EDT)Mon Sep 23 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
Mac OS speed up terminal open window
.hushlogin manual page
http://apple.stackexchange.com/questions/41743/how-do-i-speed-up-new-terminal-tab-loading-time/54167#54167
Note to Self Terminal Find Files by Sizeblog/2013/09/24/note-to-self-terminal-find-files-by-sizeMon Sep 23 2013 20:00:00 GMT-0400 (EDT)Mon Sep 23 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
Find all files that have a size >= 100MB
Macosx Delete All Files Terminalblog/2013/09/23/macosx-delete-all-files-terminalSun Sep 22 2013 20:00:00 GMT-0400 (EDT)Sun Sep 22 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
So, I needed to delete all pyc files from a project. Found a quick find option that would do just that:
For a second I thought to make an alias but as it turns out, there is a built int tool in Mac that does the same.
Mac Create Local Development Domainblog/2013/09/21/mac-create-local-development-domainFri Sep 20 2013 20:00:00 GMT-0400 (EDT)Fri Sep 20 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
Create local development site:
Add entry to Apache vhosts file:
Restart Apache:
Edit hosts file:
Create symbolic link:
Flush DNS cache:
The DNS request for that domain may already be cached. To clear the cached entry, run this...
Django Management Command Dumpdbblog/2013/09/18/django-management-command-dumpdbTue Sep 17 2013 20:00:00 GMT-0400 (EDT)Tue Sep 17 2013 20:00:00 GMT-0400 (EDT)Goliatone
Django management command: dumpdb
Simple command to dump database content into a file, and upload it to an S3 bucket.
GIST REF: https://gist.github.com/goliatone/6627702
Git Current Branch Multiple Upstream Refusing Pushblog/2013/09/17/git-current-branch-multiple-upstream-refusing-pushMon Sep 16 2013 20:00:00 GMT-0400 (EDT)Mon Sep 16 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
If you get the following git error
Solve it with:
Travis Permission Denied Bash Scriptblog/2013/09/17/travis-permission-denied-bash-scriptMon Sep 16 2013 20:00:00 GMT-0400 (EDT)Mon Sep 16 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
Running a travis build script, if you get an error like the following:
The solution is to chmod the bash script in your travis file:
Python Terminal Progress Barblog/2013/09/17/python-terminal-progress-barMon Sep 16 2013 20:00:00 GMT-0400 (EDT)Mon Sep 16 2013 20:00:00 GMT-0400 (EDT)Goliatone
Python: How to make a progress bar in terminal.
Objectivec Dynamicurl Gatewayserviceblog/2013/09/17/objectivec-dynamicurl-gatewayserviceMon Sep 16 2013 20:00:00 GMT-0400 (EDT)Mon Sep 16 2013 20:00:00 GMT-0400 (EDT)Goliatone
https://gist.github.com/goliatone/6616995
Python Unicodeencodeerrorblog/2013/09/17/python-unicodeencodeerrorMon Sep 16 2013 20:00:00 GMT-0400 (EDT)Mon Sep 16 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
PYthon: UnicodeEncodeError
It might be as simple as using the encode(utf-8) method on your string.
Git Extending with Custom Commandsblog/2013/09/16/git-extending-with-custom-commandsSun Sep 15 2013 20:00:00 GMT-0400 (EDT)Sun Sep 15 2013 20:00:00 GMT-0400 (EDT)Goliatone
Extending git with custom commands.
Aliases, would be one way to extend git. You can do things like:
To define the alias, you can do it from the terminal:
Which would create the following entry in your .gitconfig file
Show git alias
As an example...
Python Django Nginx Gunicornblog/2013/09/16/python-django-nginx-gunicornSun Sep 15 2013 20:00:00 GMT-0400 (EDT)Sun Sep 15 2013 20:00:00 GMT-0400 (EDT)Goliatone
Django code not updated after source update.
Jenkins, after code update, we need to restart gunicorn.
When the code is updated, there’s no need to restart nginx; instead, gunicorn is restarted (not so prettily) with:
kill -HUP
Python Django South Auto Error Table Alrady Existsblog/2013/09/15/python-django-south-auto-error-table-alrady-existsSat Sep 14 2013 20:00:00 GMT-0400 (EDT)Sat Sep 14 2013 20:00:00 GMT-0400 (EDT)Goliatone
South, migrations out of order
If you crate a migration and when you run it you get the following error or similar:
Also, if you are getting this error when running tests, you might as well just disable migrations when you run the...
A Form and an Afternoonblog/2013/09/14/a-form-and-an-afternoonFri Sep 13 2013 20:00:00 GMT-0400 (EDT)Fri Sep 13 2013 20:00:00 GMT-0400 (EDT)Goliatone
Quote It's only a form and an afternoon.
Boudreaux's razor.
Python Django Create User Mangement Commandblog/2013/09/11/python-django-create-user-mangement-commandTue Sep 10 2013 20:00:00 GMT-0400 (EDT)Tue Sep 10 2013 20:00:00 GMT-0400 (EDT)Goliatone
Create user command.
If you need to deploy a django application using Pupet or a similar deployment framework, this might be useful.
Javascript Prototype Shared Datablog/2013/09/10/javascript-prototype-shared-dataMon Sep 09 2013 20:00:00 GMT-0400 (EDT)Mon Sep 09 2013 20:00:00 GMT-0400 (EDT)Goliatone
Consider the following:
This seems to work well.
The issue becomes apparent in the following example:
Python Django Create Global Management Commandblog/2013/09/10/python-django-create-global-management-commandMon Sep 09 2013 20:00:00 GMT-0400 (EDT)Mon Sep 09 2013 20:00:00 GMT-0400 (EDT)Goliatone
To create a global command:
TODO: Create gist.
NOTE: Have a core app to store global commands and, generally speaking, things not tied to any...
Django Alreadyregistered Admin Errorblog/2013/09/09/django-alreadyregistered-admin-errorSun Sep 08 2013 20:00:00 GMT-0400 (EDT)Sun Sep 08 2013 20:00:00 GMT-0400 (EDT)Goliatone
Make sure you are not importing the same models in two different admin.py files. IE, if you do a copy and paste, remember to update your app name!
Javascript Callback Hellblog/2013/09/08/javascript-callback-hellSat Sep 07 2013 20:00:00 GMT-0400 (EDT)Sat Sep 07 2013 20:00:00 GMT-0400 (EDT)Goliatone
Callback hell
So, one of the biggest rants people have about JS, node specifically, is the so denominated callback hell. You know where code marches to the right faster than it moves forward. The Piramid of Doom? Common, I'm sure you know what I'm...
Testingblog/2013/09/08/testingSat Sep 07 2013 20:00:00 GMT-0400 (EDT)Sat Sep 07 2013 20:00:00 GMT-0400 (EDT)Goliatone
Something that is always appropriate, regardless of general style, is when you get a bug report. ALWAYS create a test case first & run your tests. Make sure it demonstrates the failure, THEN go fix the bug. If your fix is correct, that new test...
Egos on the Net Xxxblog/2013/09/06/egos-on-the-net-xxxThu Sep 05 2013 20:00:00 GMT-0400 (EDT)Thu Sep 05 2013 20:00:00 GMT-0400 (EDT)Goliatone
Egos on the net.
How to avoid callback hell?
Bruno Jouhier
Re: [nodejs] Re: How to avoid callback hell?
Try streamline.js. It is not a library but a language tool. Problem is solved and people should start to use real solutions instead of whining...
Python No Module Namedblog/2013/09/05/python-no-module-namedWed Sep 04 2013 20:00:00 GMT-0400 (EDT)Wed Sep 04 2013 20:00:00 GMT-0400 (EDT)Goliatone
ImportError: No module named webapp.twiliohandler
deployment
try:
from webapp.twiliohandler import TwilioHandler
except:
Python Django Create Different Environmentsblog/2013/09/05/python-django-create-different-environmentsWed Sep 04 2013 20:00:00 GMT-0400 (EDT)Wed Sep 04 2013 20:00:00 GMT-0400 (EDT)Goliatone
set environment var
http://stackoverflow.com/questions/15048963/alternative-to-the-deprecated-setup-environ-for-one-off-django-scripts
production vs development...
Git Add Gitignore Boilerplate from Terminalblog/2013/09/02/git-add-gitignore-boilerplate-from-terminalSun Sep 01 2013 20:00:00 GMT-0400 (EDT)Sun Sep 01 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
gibo is a handy shell script to use GitHub's gitignore templates.
You can download it here.
Python Regex Expandblog/2013/08/31/python-regex-expandFri Aug 30 2013 20:00:00 GMT-0400 (EDT)Fri Aug 30 2013 20:00:00 GMT-0400 (EDT)Goliatone
Pythonic. There is definitively some things I love about python.
Nano Set Tab to Spaces 4blog/2013/08/30/nano-set-tab-to-spaces-4Thu Aug 29 2013 20:00:00 GMT-0400 (EDT)Thu Aug 29 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
I use nano to do quick edits or test out ideas in a dirty and quick script. If you use python, it's a good idea to have proper indentaion. Nano has a default tab size of 8.
Edit ~/.nanorc:
If you have a file and want to conver tabs to...
Enable Port Ipblog/2013/08/30/enable-port-ipThu Aug 29 2013 20:00:00 GMT-0400 (EDT)Thu Aug 29 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
To enable a port on the server, use the internal ip of 0.0.0.0 instead of localhost/127.0.01
Download Contents of Url Recursivelyblog/2013/08/30/download-contents-of-url-recursivelyThu Aug 29 2013 20:00:00 GMT-0400 (EDT)Thu Aug 29 2013 20:00:00 GMT-0400 (EDT)Goliatone
Self note
More than once, I had the need to do a massive download of files from a URL.
Quick wget command, options are pretty self explanatory:
Bash Override Built in Methodsblog/2013/08/30/bash-override-built-in-methodsThu Aug 29 2013 20:00:00 GMT-0400 (EDT)Thu Aug 29 2013 20:00:00 GMT-0400 (EDT)Goliatone
Bash, override built in method
It turns out you can override a built in method, quite simple actually.
If you add the following to your ~/.bash_profile it will always be in effect for interactive shells.
To find the current cd definition:
rvm...
Add Syntax Support to Nanoblog/2013/08/29/add-syntax-support-to-nanoWed Aug 28 2013 20:00:00 GMT-0400 (EDT)Wed Aug 28 2013 20:00:00 GMT-0400 (EDT)Goliatone
PHP Get themes
You can download themes from here
Then, with this
Now, if you want to add syntax highlighting.
Update Nano Mac Osblog/2013/08/29/update-nano-mac-osWed Aug 28 2013 20:00:00 GMT-0400 (EDT)Wed Aug 28 2013 20:00:00 GMT-0400 (EDT)Goliatone
How to update nano on mac
homebrew-dupes: These formulae duplicate software provided by OS X, though may provide more recent or bugfix versions.
To install:
Sublime Text Show Hidden Files Guiblog/2013/08/29/sublime-text-show-hidden-files-guiWed Aug 28 2013 20:00:00 GMT-0400 (EDT)Wed Aug 28 2013 20:00:00 GMT-0400 (EDT)Goliatone
To show hidden files on the OS open dialog:
Make Git Love Terminalblog/2013/08/29/make-git-love-terminalWed Aug 28 2013 20:00:00 GMT-0400 (EDT)Wed Aug 28 2013 20:00:00 GMT-0400 (EDT)Goliatone
Note to self
Again, a quick one just to remind my self...
List of backslash scaped special character:
\a : an ASCII bell character (07)
\d : the date in "Weekday Month Date" format (e.g., "Sat Aug 31")
\D{format} : the format is passed to...
Git Autocompleteblog/2013/08/29/git-autocompleteWed Aug 28 2013 20:00:00 GMT-0400 (EDT)Wed Aug 28 2013 20:00:00 GMT-0400 (EDT)Goliatone
http://richardhulse.blogspot.com/2008/06/using-git.html To enable git autocomplete in terminal:
Then, add the following to .bashrc or .bash_profile
local and remote branch names
local and remote tag names
.git/remotes file names
git...
Profiling Anonymous Functionsblog/2013/08/28/profiling-anonymous-functionsTue Aug 27 2013 20:00:00 GMT-0400 (EDT)Tue Aug 27 2013 20:00:00 GMT-0400 (EDT)Goliatone
Anonymous functions are not easy to profile because they inherently don't have a name under which they could show up in the profiler. There are two ways to work around this:
rewrite to:
It is not commonly known that JavaScript supports naming...
Sublime Command Lineblog/2013/08/28/sublime-command-lineTue Aug 27 2013 20:00:00 GMT-0400 (EDT)Tue Aug 27 2013 20:00:00 GMT-0400 (EDT)Goliatone
Sublime terminal MacOS
To make Sublime Text available from the command line, just create a symbolic link to the app's subl command.
Update Grunt Karmablog/2013/08/27/update-grunt-karmaMon Aug 26 2013 20:00:00 GMT-0400 (EDT)Mon Aug 26 2013 20:00:00 GMT-0400 (EDT)Goliatone
Grunt Karma update.
If you update to karma 0.5.0 and get the following error:
Config file must export a function!
Basically, you need to replace your old karma.conf.js file with the new format.
Python Xrangeblog/2013/08/24/python-xrangeFri Aug 23 2013 20:00:00 GMT-0400 (EDT)Fri Aug 23 2013 20:00:00 GMT-0400 (EDT)Goliatone
Python xrange
In python, using the range function actually creates a list which it stores in memory. However, using xrange just iterates through the numbers.
range(0,5000) takes up more memory than xrange(0,5000)
Here is a quick example of what I...
Javascript Strict Modeblog/2013/08/22/javascript-strict-modeWed Aug 21 2013 20:00:00 GMT-0400 (EDT)Wed Aug 21 2013 20:00:00 GMT-0400 (EDT)Goliatone
//////////////////// Take a look, maybe we can use jsfiddle to embed tests?
http://doc.jsfiddle.net/use/embedding.html
////////////////////
http://www.nczonline.net/blog/2012/03/13/its-time-to-start-using-javascript-strict-mode/
I am sure you have...
S3cmd Backupblog/2013/08/21/s3cmd-backupTue Aug 20 2013 20:00:00 GMT-0400 (EDT)Tue Aug 20 2013 20:00:00 GMT-0400 (EDT)Goliatone
http://s3tools.org/s3cmd-sync
Rsync Backupblog/2013/08/21/rsync-backupTue Aug 20 2013 20:00:00 GMT-0400 (EDT)Tue Aug 20 2013 20:00:00 GMT-0400 (EDT)Goliatone
Remote backups with rsync (MacOS => Ubuntu)
http://www.dedoimedo.com/computers/rsync-guide.html
http://www.evbackup.com/support-rsync-setup/
http://superuser.com/questions/286911/save-output-to-a-text-file-from-mac-terminal
TODO: UPDATE EXAMPLE...
Nvm Node Version Managerblog/2013/08/19/nvm-node-version-managerSun Aug 18 2013 20:00:00 GMT-0400 (EDT)Sun Aug 18 2013 20:00:00 GMT-0400 (EDT)Goliatone
nvm is to node what rvm is to ruby. If you want to have multiple versions of Node installed in the same machine, then this is the way to go.
To install on Mac:
To list available versions, if you have brew installed, you can run:
Then, you can...
Github Redirects Untar Bashblog/2013/08/13/github-redirects-untar-bashMon Aug 12 2013 20:00:00 GMT-0400 (EDT)Mon Aug 12 2013 20:00:00 GMT-0400 (EDT)Goliatone
Github redirect, tar, release
Github Tar Redirect Bashblog/2013/08/13/github-tar-redirect-bashMon Aug 12 2013 20:00:00 GMT-0400 (EDT)Mon Aug 12 2013 20:00:00 GMT-0400 (EDT)Goliatone
Github redirect, tar, release
Mysql 5 5 Now Bugblog/2013/08/12/mysql-5-5-now-bugSun Aug 11 2013 20:00:00 GMT-0400 (EDT)Sun Aug 11 2013 20:00:00 GMT-0400 (EDT)Goliatone
consider the following query:
If you are running mysql
solution:
Ubuntu Update Ipblog/2013/08/10/ubuntu-update-ipFri Aug 09 2013 20:00:00 GMT-0400 (EDT)Fri Aug 09 2013 20:00:00 GMT-0400 (EDT)Goliatone
change ip ubuntu
https://help.ubuntu.com/10.04/serverguide/network-configuration.html
http://www.jonathanmoeller.com/screed/?p=2961
sudo ifconfig eth0 10.0.0.100 netmask 255.255.255.0
Egos on the Net Xxblog/2013/08/10/egos-on-the-net-xxFri Aug 09 2013 20:00:00 GMT-0400 (EDT)Fri Aug 09 2013 20:00:00 GMT-0400 (EDT)Goliatone
Egos on the Net
Python list
Steven D'Aprano
On Mon, 07 Jan 2013 18:35:20 +0800, iMath wrote:
what’s the
difference between socket.send() and socket.sendall()
?
Please re-send your question as text, instead of as HTML (so-called "rich...
Installing Bundle Mysqlblog/2013/08/10/installing-bundle-mysqlFri Aug 09 2013 20:00:00 GMT-0400 (EDT)Fri Aug 09 2013 20:00:00 GMT-0400 (EDT)Goliatone
installing bundle mysql fails in ubuntu
http://stackoverflow.com/questions/8874513/installing-mysql2-gem-for-ruby-on-rails-3-1-0
An error occured while installing mysql2 (0.3.13), and Bundler cannot
continue. Make sure that gem install mysql2 -v...
Installing S3cmd Gpgblog/2013/08/10/installing-s3cmd-gpgFri Aug 09 2013 20:00:00 GMT-0400 (EDT)Fri Aug 09 2013 20:00:00 GMT-0400 (EDT)Goliatone
when you install s3cmd tools, you get a prompt that ask for gpg program.
if you run which gpg in another terminal and you get nothing, follow:
http://www.gpgtools.org/installer/index.html
then, if you run which gpg again, you should get something...
Localpacketsniffingdebugtrafficblog/2013/08/07/localpacketsniffingdebugtrafficTue Aug 06 2013 20:00:00 GMT-0400 (EDT)Tue Aug 06 2013 20:00:00 GMT-0400 (EDT)Goliatone
Troubleshooting You can see the raw values received by pystatsd by packet sniffing:
You can see the raw values dispatched to carbon by packet sniffing:
Stuffblog/2013/08/03/stuffFri Aug 02 2013 20:00:00 GMT-0400 (EDT)Fri Aug 02 2013 20:00:00 GMT-0400 (EDT)Goliatone
My self-summary
I...
have lived 12 years in barcelona.
loose things and find things... I mostly find things.
Two soccer goals and one basketball ring have fallen on my head.
have never broken a bone.
grew up in a island.
have a deficit of 20,000...
Composer Import Old Libsblog/2013/07/29/composer-import-old-libsSun Jul 28 2013 20:00:00 GMT-0400 (EDT)Sun Jul 28 2013 20:00:00 GMT-0400 (EDT)Goliatone
Let's say that you need to use an old library that is no longer mantained or simply not using composer.
So, composer provides an autoloader. It handles 3 types of methods, PSR-0, classmap, and files.
In your composer.json file, you can define a...
Neo4j Installblog/2013/07/12/neo4j-installThu Jul 11 2013 20:00:00 GMT-0400 (EDT)Thu Jul 11 2013 20:00:00 GMT-0400 (EDT)Goliatone
INstall: To enable node_auto_index:
Add the following to the neo4j.properties file
/usr/local/Cellar/neo4j/community-1.9.1-unix/libexec/conf/neo4j.properties
Modify and uncomment
Create the auto index for nodes, go to shel
neo4j-sh (0)$ index...
Node Phpblog/2013/07/11/node-phpWed Jul 10 2013 20:00:00 GMT-0400 (EDT)Wed Jul 10 2013 20:00:00 GMT-0400 (EDT)Goliatone
http://blog.revathskumar.com/2013/04/using-yeoman-with-php.html Mac, php, node, grunt ::)
Middleware to handle php
Add middleware call to livereload in connect options:
To the watch task config options, add the php extension to the...
Serve Git from Local Computer Ipblog/2013/06/25/serve-git-from-local-computer-ipMon Jun 24 2013 20:00:00 GMT-0400 (EDT)Mon Jun 24 2013 20:00:00 GMT-0400 (EDT)Goliatone
Serve git from local computer IP
http://stackoverflow.com/questions/15670692/git-equivalent-of-hg-serve
For just browsing files and revisions git instaweb is the right solution.
In addition if you want to set-up an ad-hock git server for sharing work...
Between the Ideablog/2013/06/23/between-the-ideaSat Jun 22 2013 20:00:00 GMT-0400 (EDT)Sat Jun 22 2013 20:00:00 GMT-0400 (EDT)Goliatone
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
Qp Php Email Subject Encodingblog/2013/06/19/qp-php-email-subject-encodingTue Jun 18 2013 20:00:00 GMT-0400 (EDT)Tue Jun 18 2013 20:00:00 GMT-0400 (EDT)Goliatone
http://en.wikipedia.org/wiki/Quoted-printable http://stackoverflow.com/a/4389755/125083
quoted printable decode
http://php.net/manual/en/function.quoted-printable-encode.php
Not...
Do Not Outsmart Your Customersblog/2013/05/04/do-not-outsmart-your-customersFri May 03 2013 20:00:00 GMT-0400 (EDT)Fri May 03 2013 20:00:00 GMT-0400 (EDT)Goliatone
Do not outsmart your customers.
So, I was in Nice, France, and went to this restaurant. I look over the menu and decided on a nice filet mignon. I ordered it well done, to the dismai of the waiter who did not hessitate to tell me that
Nultibytestringsblog/2013/04/23/nultibytestringsMon Apr 22 2013 20:00:00 GMT-0400 (EDT)Mon Apr 22 2013 20:00:00 GMT-0400 (EDT)Goliatone
htmlspecialchars(): Invalid multibyte sequence in argument
mb_string instead of trim
Passionblog/2013/04/04/passionWed Apr 03 2013 20:00:00 GMT-0400 (EDT)Wed Apr 03 2013 20:00:00 GMT-0400 (EDT)Goliatone
http://www.brainpickings.org/index.php/2012/02/27/purpose-work-love/ Work is what we do by the hour. It begins and, if possible, we do it for money. Welding car bodies on an assembly line is work; washing dishes, computing taxes, walking the rounds...
Pulling Ropesblog/2013/03/22/pulling-ropesThu Mar 21 2013 20:00:00 GMT-0400 (EDT)Thu Mar 21 2013 20:00:00 GMT-0400 (EDT)Goliatone
Building software always starts with a problem.
If we make an analogy and think of this problem as a rock that needs to be transported, then we can depict the following history.
To move a rock, you can throw it or if its too big to grip you can push...
Chaosblog/2013/02/26/chaosMon Feb 25 2013 19:00:00 GMT-0500 (EST)Mon Feb 25 2013 19:00:00 GMT-0500 (EST)Goliatone
life is a mess, emotions, chaos, entropy. A flow of accumulative stream of random emotions. Disconnected and unitary.
But also, full of potential, endless combinations, infinite ways of threading reality.
cosmological view of emotions. Emotions as...
Headlinesblog/2013/01/11/headlinesThu Jan 10 2013 19:00:00 GMT-0500 (EST)Thu Jan 10 2013 19:00:00 GMT-0500 (EST)Goliatone
Don't be a 'Hammer', be water my friend.
If a hammer is the only tool you have, then you will identify all problems as nails.
Water, path of least resistence.
Before you DRY, you should be WET. Don Repeat Yourself = Write Everyting Trice
Do not...
Processblog/2013/01/06/processSat Jan 05 2013 19:00:00 GMT-0500 (EST)Sat Jan 05 2013 19:00:00 GMT-0500 (EST)Goliatone
If every sprint fails but the product is stellar, was scrum working or failing? I'd argue working.
My initial conclusion: success. If a process is a series of steps taken to achieve an end, a stelar product is fulfilling the goal.
I think the...
Soccerblog/2013/01/06/soccerSat Jan 05 2013 19:00:00 GMT-0500 (EST)Sat Jan 05 2013 19:00:00 GMT-0500 (EST)Goliatone
As long as I can remember there has been a bar debate about soccer and two of its main conflicting phylosofies.
Resultadism vs Stylism. Resultadism values the direct result, sacrificing the means to achieve its result. Victory.
Stylism values how...
Project: Open Luxury Daysblog/2012/03/01/project-open-luxury-daysWed Feb 29 2012 19:00:00 GMT-0500 (EST)Wed Feb 29 2012 19:00:00 GMT-0500 (EST)Goliatone
After a short but intense development cycle, here it is: www.openluxurydays.com
For this project I used the Kohana libraries I've released as open source on github. Every project is a good chance to keep them sharp and find/squish bugs.
More soon...
CSS: Gradient bordersblog/2012/02/08/css-gradient-bordersTue Feb 07 2012 19:00:00 GMT-0500 (EST)Tue Feb 07 2012 19:00:00 GMT-0500 (EST)Goliatone
Just a quick snippet to make linear gradient borders.
Php Phpunit Windows Setupblog/2011/12/27/php-phpunit-windows-setupMon Dec 26 2011 19:00:00 GMT-0500 (EST)Mon Dec 26 2011 19:00:00 GMT-0500 (EST)Goliatone
Error windows phpunit could not open input file . pear phpunit2 textui testrunner.php
To install PHP et al under windows, I used xampp. To fix this error, I had to edit phpunit.bat and update the paths to the php.exeand to the *PEAR directory.
Also...
Ror Autotest Error Windowsblog/2011/12/11/ror-autotest-error-windowsSat Dec 10 2011 19:00:00 GMT-0500 (EST)Sat Dec 10 2011 19:00:00 GMT-0500 (EST)Goliatone
I get this error when trying to run autotest-standalone- The following stacktrace :
C:/Ruby/lib/ruby/gems/1.8/gems/autotest-standalone-4.5.2/lib/unit_diff.rb:77:in write': Invalid argument (Errno::EINVAL)
Solution,
replaced putc of lib/autotest.rb @...
Red5 Install as Daemon on Ubuntublog/2011/12/03/red5-install-as-daemon-on-ubuntuFri Dec 02 2011 19:00:00 GMT-0500 (EST)Fri Dec 02 2011 19:00:00 GMT-0500 (EST)Goliatone
sudo useradd _red5 #create user that will run the red5-server daemon.
sudo nano /etc/init.d/red5-server #create the sh script. paste contents ::from::
sudo chmod a+x /ect/init.d/red5-server #make it executable
sudo update-rc.d red5-server defaults...
Kohana: php CLIblog/2011/12/03/kohana-php-cliFri Dec 02 2011 19:00:00 GMT-0500 (EST)Fri Dec 02 2011 19:00:00 GMT-0500 (EST)Goliatone
In windows, you need to set up your environment variables to execute php conformable from your command line.
You can follow the instructions provided by the PHP manual, which is pretty clear. One thing to remember is that your PATH variable needs to...
Htaccess Directoryblog/2011/12/01/htaccess-directoryWed Nov 30 2011 19:00:00 GMT-0500 (EST)Wed Nov 30 2011 19:00:00 GMT-0500 (EST)Goliatone
I need to make all content under a certain directory with one exception. There is one directory that has to be accessible through the browser.
The layout could be something like this:
backend/
|-admin
|-system
|-themes
|-uploads
You can deny all...
As3 Google Url Shortening Utilityblog/2011/12/01/as3-google-url-shortening-utilityWed Nov 30 2011 19:00:00 GMT-0500 (EST)Wed Nov 30 2011 19:00:00 GMT-0500 (EST)Goliatone
Recently I needed to use a URL shortening service. I decided to go with Google's goo.gl
I made a simple utility class to make use of the service. It will shorten any URL you or expand a previously shortened URL.
It also features a simple cache...
Java Ant Build Errorblog/2011/11/26/java-ant-build-errorFri Nov 25 2011 19:00:00 GMT-0500 (EST)Fri Nov 25 2011 19:00:00 GMT-0500 (EST)Goliatone
Error: C:...\build.xml:21: java.lang.UnsupportedClassVersionError:
com/sun/tools/javac/Main : Unsupported major.minor version 51.0
The 'Unsupported major.minor version 51.0' means somewhere code was compiled for a version of the JDK, and that...
Jangaroo Compiling Flashpunk Portblog/2011/11/24/jangaroo-compiling-flashpunk-portWed Nov 23 2011 19:00:00 GMT-0500 (EST)Wed Nov 23 2011 19:00:00 GMT-0500 (EST)Goliatone
FlashPunk lib:
mvn install
Flashpunk tutorial
mvn package
AS3: Keep your UI's DRYblog/2011/11/23/as3-keep-your-ui-s-dryTue Nov 22 2011 19:00:00 GMT-0500 (EST)Tue Nov 22 2011 19:00:00 GMT-0500 (EST)Goliatone
Consider the following code snippet. Real world code, a form with multiple icons:
//contactIconBtn
var contactIconBtn:Sprite = _skin.getAssetAs("contactIconBtn", Sprite, null );
_contactIconBtn = new OSIconButton(contactIconBtn);
...
Apache not booting on windowsblog/2011/11/17/apache-not-booting-on-windowsWed Nov 16 2011 19:00:00 GMT-0500 (EST)Wed Nov 16 2011 19:00:00 GMT-0500 (EST)Goliatone
Quick note. If apache is missbehaving on windows, and does not boot make sure that skype is not configured to run on port 80.
As3 Error 1069blog/2011/11/16/as3-error-1069Tue Nov 15 2011 19:00:00 GMT-0500 (EST)Tue Nov 15 2011 19:00:00 GMT-0500 (EST)Goliatone
http://www.codebelt.com/actionscript-3/as3-onbwdone-error-flash-media-server-with-amazon-cloudfront/ Error #1069
_netConnection.client = new NetConnectionClient;
package com.skinnygeek.media.video {
import com.skinnygeek.logging.Logger;
}
Also...
Ruby Rubyscript2exe Errorblog/2011/11/15/ruby-rubyscript2exe-errorMon Nov 14 2011 19:00:00 GMT-0500 (EST)Mon Nov 14 2011 19:00:00 GMT-0500 (EST)Goliatone
http://mentedolulu.blogspot.com/2009/07/bug-rubyscript2exe-rubyscript2exerb621i.html ruby rubyscript2exe.rb helloworld.rb
rubyscript2exe.rb:621:in replace': can't modify frozen string (TypeError)
from rubyscript2exe.rb:621
from...
IE: Page renders, then 404blog/2011/11/15/ie-page-renders-then-404Mon Nov 14 2011 19:00:00 GMT-0500 (EST)Mon Nov 14 2011 19:00:00 GMT-0500 (EST)Goliatone
The issue:
Page loads in IE but after it's completely rendered, it goes 404.
This is exactly what was happening recently to this site. It was working as expected locally but once deployed to Heroku, every page went 404 on IE.
It turns out that the...
Ubuntu Install Ssl Certificateblog/2011/11/14/ubuntu-install-ssl-certificateSun Nov 13 2011 19:00:00 GMT-0500 (EST)Sun Nov 13 2011 19:00:00 GMT-0500 (EST)Goliatone
http://library.linode.com/web-servers/apache/ssl-guides/ubuntu-10.04-lucid
Toto: URL Rewritingblog/2011/11/14/toto-url-rewritingSun Nov 13 2011 19:00:00 GMT-0500 (EST)Sun Nov 13 2011 19:00:00 GMT-0500 (EST)Goliatone
There is one entry on toto's github wiki which explains how to set up a redirect:
If I include this on my config.ru the app crashes. Lookin at the logs, i can see something like:
The solution is quite simple actually. Just update the version in...
Ubuntu Install Phpmyadminblog/2011/11/14/ubuntu-install-phpmyadminSun Nov 13 2011 19:00:00 GMT-0500 (EST)Sun Nov 13 2011 19:00:00 GMT-0500 (EST)Goliatone
http://library.linode.com/databases/mysql/phpmyadmin-ubuntu-10.10-maverick apt-get update
apt-get upgrade --show-upgraded
phpMyAdmin requires the mcrypt PHP module
apt-get install php5-mcrypt
/etc/init.d/apache2 restart
Installing phpMyAdmin
apt-get...
Java Home Java Pathblog/2011/11/11/java-home-java-pathThu Nov 10 2011 19:00:00 GMT-0500 (EST)Thu Nov 10 2011 19:00:00 GMT-0500 (EST)Goliatone
java home: C:\DEV\JAVA\32\jre6;C:\DEV\JAVA\jdk1.6.0_26
java path: C:\DEV\JAVA\32\jre6
C:\Program Files (x86)\ActiveState Komodo Edit 6\;C:\Program Files (x86)\NVIDIA...
Ruby Redcloth Error Markdown Hmlblog/2011/11/10/ruby-redcloth-error-markdown-hmlWed Nov 09 2011 19:00:00 GMT-0500 (EST)Wed Nov 09 2011 19:00:00 GMT-0500 (EST)Goliatone
windows ruby install textile
How to install RedCloth on Windows?
NEST error => using haml:
Haml::Error at /examples/using-haml
Can't run Textile filter; required file 'redcloth' not found
file: (TEMPLATE)
location: nil
line: 39
NESTA...
CSS: Decimal values in Chromeblog/2011/11/03/css-decimal-values-in-chromeWed Nov 02 2011 20:00:00 GMT-0400 (EDT)Wed Nov 02 2011 20:00:00 GMT-0400 (EDT)Goliatone
It seems like Chrome does not render decimals for pixel values. The following works in FF and IE but not in Chrome:
letter-spacing: -0.5px;
However, the following does work as expected:
letter-spacing: -1px;
Also, it seems like it wont go...
Installing Toto in Herokublog/2011/10/28/installing-toto-in-herokuThu Oct 27 2011 20:00:00 GMT-0400 (EDT)Thu Oct 27 2011 20:00:00 GMT-0400 (EDT)Goliatone
Deploying toto in Heroku has been a breeze. I decided to go with toto for it's simplicity. In terms of code is really manageable, I think the main class might have around 350 lines of code- it is build on top of Rack with takes does much of the...
Hello Totoblog/2011/10/27/hello-totoWed Oct 26 2011 20:00:00 GMT-0400 (EDT)Wed Oct 26 2011 20:00:00 GMT-0400 (EDT)Goliatone
So, everybody wants to be cool. Right? Nowadays cool kids either grow a french mustache, wear thick framed glasses, or code in Ruby. I decided to go with option number 3 and learn Ruby.
I had exposure to the language, mainly through Project Sprouts...
Mxmclerrorblog/2011/10/12/mxmclerrorTue Oct 11 2011 20:00:00 GMT-0400 (EDT)Tue Oct 11 2011 20:00:00 GMT-0400 (EDT)Goliatone
http://jase21.blogspot.com/2010/07/mxmlc-error-loading-dprogram.html mxmlc Error Loading: "D:\Program Files\Java\jre6\bin\server\jvm.dll"
mxmlc which is the flex compiler requires that you have Java Runtime Environment installed in you system which...
Kohana Config, lesson learnedblog/2011/09/24/kohana-config-lesson-learnedFri Sep 23 2011 20:00:00 GMT-0400 (EDT)Fri Sep 23 2011 20:00:00 GMT-0400 (EDT)Goliatone
The way you access configuration options in Kohana is through the Kohana::config('config-file.parameter-name') method and you screw the parameter name and request something that is undefined things go hire wire, nuts, crazy, loco. For...
Kohana PHP Errorblog/2011/09/24/kohana-php-errorFri Sep 23 2011 20:00:00 GMT-0400 (EDT)Fri Sep 23 2011 20:00:00 GMT-0400 (EDT)Goliatone
Installing a Kohana application is pretty straight forward. There is a php install script that verifies the environment to make sure all goes smoothly once up and running.
You have to make sure the application/cache and application/logs directories...
Koaha Git Project Setupblog/2011/08/28/koaha-git-project-setupSat Aug 27 2011 20:00:00 GMT-0400 (EDT)Sat Aug 27 2011 20:00:00 GMT-0400 (EDT)Goliatone
we will be using unffudle.
create project local, follow instructions at:
Introduction
Git is a distributed version control system, originally developed by Linus Torvalds for Linux kernel development. It has grown over the years to serve as the...
Flex AS3 AMFPHP encoding issuesblog/2011/08/10/flex-as3-amfphp-encoding-issuesTue Aug 09 2011 20:00:00 GMT-0400 (EDT)Tue Aug 09 2011 20:00:00 GMT-0400 (EDT)Goliatone
I'm working on a project that uses AMFPHP and that has two clients; a Flex AIR back-end client, and a Flash front-end client.
Im experiencing issues with class mapping from AMFPHP to AS3 on the Flex client only, getting the following error:
The flash...
Load JavaScript libraries from Flashblog/2011/08/09/load-javascript-libraries-from-flashMon Aug 08 2011 20:00:00 GMT-0400 (EDT)Mon Aug 08 2011 20:00:00 GMT-0400 (EDT)Goliatone
If we have the need to load a javascript library from our flash application, we can use this class.
We can use this JSLibraryLoader as an example of what we can do if we build on top of a simple class taking care of one specific concern. We are going...
AS3: StringTemplate classblog/2011/08/06/as3-stringtemplate-classFri Aug 05 2011 20:00:00 GMT-0400 (EDT)Fri Aug 05 2011 20:00:00 GMT-0400 (EDT)Goliatone
A simple class can many times be a powerful tool to build more complex stuff on top.
By simple a mean that has few or one concern, and takes care of an initially uninteresting task. The StringTemplate might be an example of that.
What it does is...
Mxmcl Errorblog/2011/07/23/mxmcl-errorFri Jul 22 2011 20:00:00 GMT-0400 (EDT)Fri Jul 22 2011 20:00:00 GMT-0400 (EDT)Goliatone
Just formatted my box and while doing a fresh install of FlashDevelop, I kept getting this error:
mxmlc Error Loading: "D:\Program Files\Java\jre6\bin\server\jvm.dll"
The flex compiler (mxmlc) requires that you have the JRE installed in your...
MySQL SSH tunnel with puttyblog/2011/06/03/mysql-ssh-tunnel-with-puttyThu Jun 02 2011 20:00:00 GMT-0400 (EDT)Thu Jun 02 2011 20:00:00 GMT-0400 (EDT)Goliatone
Just a quick note to an article on linode's library that explains how to make a mysql tunnel on Windows with putty.
Just remember that while you have the tunnel open all calls to localhost will get..well, tunneled, meaning that you will not be able...
Ubuntu SFTP jails setup reviewblog/2011/05/24/ubuntu-sftp-jails-setup-reviewMon May 23 2011 20:00:00 GMT-0400 (EDT)Mon May 23 2011 20:00:00 GMT-0400 (EDT)Goliatone
After setting up a SFTP only chroot jail I had to log with Filezilla and got error:
Error: Server unexpectedly closed network connection
Error: Unable to connect to server
The set up was working previously so I had no idea what was...
Ubuntu SFTP jails setupblog/2011/05/23/ubuntu-sftp-jails-setupSun May 22 2011 20:00:00 GMT-0400 (EDT)Sun May 22 2011 20:00:00 GMT-0400 (EDT)Goliatone
Quick note on how to limit user's access with SFTP Jails on Ubuntu.
Access the ssh config file
nano /etc/ssh/sshd_config
Modify so that it contains the line
Add the following block to the end of the file:
Match group filetransfer
...
_posts/2015-11-14-.ds_storeGoliatone
title: " Ds Store"
date: 2015-11-13
template:...
_posts/2014-04-30-travis-node-karma-build-errorGoliatone
title: "Travis Node Karma Build Error"
date: 2014-04-29
template: "post.hbs"
List of karma build erorrs:
One thing that is frustrating, and recurrent engouh; karma build errors on travis.
files not found:
If karma does not find your files, it will...
_posts/2014-03-16-karma-travis-debug-warningsGoliatone
title: "Karma Travis Debug Warnings"
date: 2014-03-15
template: "post.hbs"
Karma, dependency hell.
I have a few projects running continuous integration with travis-ci
After updating one of my projects to a newer version of karma, the builds in travis...