The following article gives a more sophisticated view of clear code communication using Git trees. Over the (recommended!) NVIE "A successful Git branching model" you can do squash commits and other techniques to quickly write reliable and easily reviewed code.
Understanding the Git Workflow
Monday, March 18, 2013
Thursday, March 14, 2013
Emacs: save all modified buffers
add to ~/.emacs.d/init.el:
(global-set-key
(kbd "
(lambda ()
(interactive)
(save-some-buffers t)))
JSHint picks bits of fluff from your JavaScript
Install
sudo apt-get install npm
sudo npm install jshint -g
Usage
JSHint doesn't understand Django tags. This hack lets us check some of the code anyway:egrep -v '{%' _v2-brandcard.js | jshint --verbose /dev/stdin
Saturday, March 2, 2013
notes on the Mele A3700 Android media player #2
Now using "thoggen" to rip DVD's main feature into a single video, so the little Android apps can play them. Default video type is OGV, which is a little weird. I ripped a sample 9 minute sample full resolution to see we could get to work:
Results so far:
Dolphin: works, software, unusable
ES Media Player: no OGV
FireAir: no OGV
JoeVLC: it works! Alas out of sync
MX Player: works! Hardware decoder works too!
QQ Player: nope
RockPlayer2: software, unusable
TvdVideo: nope
http://www.cyberciti.biz/tips/linux-dvd-ripper-software.html
Results so far:
Dolphin: works, software, unusable
ES Media Player: no OGV
FireAir: no OGV
JoeVLC: it works! Alas out of sync
MX Player: works! Hardware decoder works too!
QQ Player: nope
RockPlayer2: software, unusable
TvdVideo: nope
http://www.cyberciti.biz/tips/linux-dvd-ripper-software.html
notes on the Mele A3700 Android media player
This device is a cheap ($130) box which lets you play movies on your TV. As it runs Android, you can get a zillion apps to do other things, especially for playing games. It comes with a white remote which is a mouse! The idea is to connect it to your HDMI TV, a USB hard drive, then you'll never have to leave the couch again.
It's very cranky.
I bought this device to play DVDs (ISOs). For some reason this is nearly impossible to do under normal Android apps. Here are the results so far:
Joe VLC: ISO tried to play, then croaked
QQ Player: tries to play, no menu control
Rockplayer2 -- plays ISOs, software only, video completely separate from audio.
Also tested:
Dolphin player: no ISO
ES Media Player: no ISO
FireAir Player: no ISO
MX Player: no ISO(?)
Super-HD player: no ISO
TVD Player: no ISO
It's very cranky.
I bought this device to play DVDs (ISOs). For some reason this is nearly impossible to do under normal Android apps. Here are the results so far:
Joe VLC: ISO tried to play, then croaked
QQ Player: tries to play, no menu control
Rockplayer2 -- plays ISOs, software only, video completely separate from audio.
Also tested:
Dolphin player: no ISO
ES Media Player: no ISO
FireAir Player: no ISO
MX Player: no ISO(?)
Super-HD player: no ISO
TVD Player: no ISO
Friday, February 8, 2013
command-line JSLint
Finding syntax errors and so forth is not work for programmers, it's a job for our very fast but dumb slaves, the computers. Here is how to harness their power for good, by showing possible bugs in our JavaScript programs.
cd ~/src/jslint/
wget https://raw.github.com/douglascrockford/JSLint/master/jslint.js
echo '#!/bin/bash' >> ~/bin/jslint
echo 'rhino -f ~/src/jslint/jslint.js $*' >> ~/bin/jslint
install a command-line JavaScript interpreter, Rhino
sudo apt-get install rhinoinstall JavaScript checker
mkdir -p ~/src/jslint/cd ~/src/jslint/
wget https://raw.github.com/douglascrockford/JSLint/master/jslint.js
create a little wrapper
mkdir -p ~/bin/echo '#!/bin/bash' >> ~/bin/jslint
echo 'rhino -f ~/src/jslint/jslint.js $*' >> ~/bin/jslint
Add ~/bin/ to your PATH
Test the checker
$ echo 'alert(ding)' >>testme.js
$ jslint !$
jslint testme.js
js: uncaught JavaScript runtime exception: ReferenceError: "ding" is not defined.
It works! In our sample code, we call "alert(ding)" using an undefined variable. The code should be "alert('ding')" -- a quoted string.
Writing Testable Frontend Javascript
It's said that a program without tests doesn't exist. Adding code often
creates as many bugs as features. Just now I found an excellent,
concrete article that makes it much easier to test dynamic web pages
like ours:
https://shanetomlinson.com/2013/testing-javascript-frontend-part-1-anti-patterns-and-fixes/
https://shanetomlinson.com/2013/testing-javascript-frontend-part-1-anti-patterns-and-fixes/
Subscribe to:
Posts (Atom)