22 May 2014

CJK names

because size matters

AaronH says: In iSIS we need search all school data in many different country, so I need check the search input size limit, default is 3 chars limit, but some school in China, Korea or Japan, people name only have 2~4 characters, if we still use limit size 3, it no make sense, so I use RegExp to check inputing word in a smart way.

22 May 2014

Borders on retina

to get the right thickness

Naiting noticed that on retina display there is something weird with css borders, the 1px border actually shows up like 2px. Here is an easy trick to avoid it:

.border-retina
      box-shadow: 0 1px 0px -0.5px red

see it in action on http://codepen.io/sliiice/pen/xAqei

22 May 2014

Annotate

for models and routes

Ilake has some special feelings for the annotate gem: https://github.com/ctran/annotate_models

It will prepend the table schema on the model, and also in the routes with annotate --routes then you don’t need to check database, or schema.rb anymore. It is pretty convenient.

22 May 2014

Alfred

to shortcut to convenient places

There is one app heavily used by Johnny, named Alfred http://www.alfredapp.com

It is good for launch tasks by typing command. For example, I want to look up a work I don’t know I can type:

LAUNCHKEY + define + WORD_I_DONT_KNOW

and it will open the dictionary in Mac for explanation.

It also have a powerful function called WorkFlow. It allows you to combine multiple action at once. Recently I wrote a work flow to launch Transmit to sync the daily db dump folder on OA production server because I noticed I pretty much have to do this every other day.

16 May 2014

Todos in sublimetext

with plaintasks plugin

UA Team wants to spread the word about one tiny SublimeText plugin named PlainTasks. It helps to maintain your own to-dos for a project which are too small or too internal to be put on BC.

It tracks the issue resolution time too! The screenshot is attached.

plaintasts plugin

15 May 2014

Text expander

when fingers are tired

Johnny is back this week and joins the geek fun with this small app. It is called Text Expander https://smilesoftware.com/TextExpander. It can link a whole text to a user defined shortcut. I use it to fill in quickly for some canned info, replying BC and debugging.

Lets say I want to debug a paragraph of code with pry, and i am too lazy to type binding.remote_pry over and over. So I could link this code with pry+SPACE and next time i can spell it out when i need it.

15 May 2014

Testing in Vim

inside tmux

iLake has another console trick this week. With vim, he uses tmux, with zeus or spring, and Turbux + tslime

and combine with zeus or spring

let g:turbux_command_rspec = 'zeus rspec'

Then you can test your rspec smooth and fast without leaving vim (and pretend you use emacs in fact).

15 May 2014

SVG path animation

with d3.js
Naiting while working on isis graphs played a bit with D3.js special features and gathered his discoveries on a pen at

See the Pen xIqdl by naiting (@sliiice) on CodePen.

15 May 2014

Rails models namespacing

to avoid cluttering

iHower has a trick for models files organization. For example there are too many transcript related files under app/models, so we can move all to sub-directory app/models/transcript very easily:

  • Add app/models/transcript to config.autoload_paths in config/application.rb
  • git mv transcript related files to app/models/transcript

The advantage is that we don’t need to modify any transcript code when moving. Sometimes adding namespace is error-prone and unnecessary.

15 May 2014

PDF.js

another way to render pdfs on a web page

This week AaronH integrated Mozilla PDF.js to our front-end side for previewing the export of transcript pdf. It renders in a canvas element by reading the damn real PDF file with javascript so we can see a real pdf result.

http://mozilla.github.io/pdf.js/