Its a little ruby script that in 1 command takes one or several CSV files, parses their structure into simplistic sqlite table definitions, and then creates a new sqlite database file populated with structure and data from these CSVs.
201 karma · joined October 7, 2011
Its a little ruby script that in 1 command takes one or several CSV files, parses their structure into simplistic sqlite table definitions, and then creates a new sqlite database file populated with structure and data from these CSVs.
http://www.amazon.com/Mastering-Nginx-Dimitri-Aivaliotis/dp/...
Eg why can't github just let visitors preview this html file: https://gist.github.com/dergachev/5769111#file-index-html
For now, I have to link bl.ocks.org, which is nice but far from perfect. And check out http://htmlpreview.github.io
(I understand that there are security concerns, but I'm sure they can be addressed with an iframe or by clicking an external link)
I'm just testing them now, and I'm not ready to point a real domain at them yet.
Basically you put your DO api key in your Vagrant file, and then running "vagrant up --provider=digital_ocean" spins up a new ubuntu VM and runs your chef/puppet provisioner code on them. It's awesome!
It uses rsync to mirror your vagrant project directory to /vagrant, which is a actually better workflow for some use cases (eg hosting) than virtualbox shared folders.
As an experiment, I wrote a quick ruby script called csv2sqlite which parses one more CSV files (and their headers), and automatically populates an SQLite database based on the CSV.
If you have a CSV and want to easily know how many records it has, or to filter or join these records, it can be just a matter of running something like following:
ruby ~/csv2sqlite/csv2sqlite.rb baby-names-10.csv --output babynames.db
sqlite3 babynames.db "SELECT * FROM baby_names_10 WHERE percent > .05;"
Hope it helps you!
Edit: demos are working fine now.
For an example use, view the source of http://dergachev.github.com/pin-screenshot-bookmarklet
It automatically extracts the title of the current page and appends it to the URL, like so:
http://www.youtube.com/watch?v=v-pyuaThp-c#doodling-in-math-... http://ihackernews.com/comments/5043231#hacker-news-mobile-d... https://github.com/dergachev/chrome-xpath-link/issues/2#crea... http://news.ycombinator.com/item?id=5043231#devopssysadmin-c... http://drupal.org/node/1427148#meta-how-should-joke-modules-... https://gist.github.com/4331769#rule-of-thirds-bookmarklet http://bl.ocks.org/4360892#u.s.-airports http://www.redmine.org/issues/12778#defect-12778-upgrade-to-... https://twitter.com/dergachev/status/290914183220981760#twit.... https://docs.google.com/spreadsheet/ccc?key=0AonYZs4MzlZbdER... https://issues.apache.org/jira/browse/SOLR-4305#solr-4305-xs... http://www.craigslist.org/about/best/inl/2434325556.html#bes... http://www.flickr.com/photos/54771108@N07/6959604522/#circus...
But often you can't upload videos or javascript, but only a GIF, like on a github.com's README file.
For that scenario, I recently wrote up a quick tutorial on how to use Quicktime + FFmpeg + gifsice to easily create a short screencast and convert it into a GIF.
GIFs auto play, and so might be good medium to force a user to see a 7-15 second clip of how a feature works. Obviously you should ensure that only 1 is ever showed at a time.
I also find there's something hypnotic about a silently looping sped-up clip, though I don't know if this can be used to increase conversions. ;)
Yesterday I wrote a tutorial on how to easily create one on OS X using just free tools: Quicktime Player, ffmpeg, and gifsicle.
https://gist.github.com/4627207
(Animated GIFs might also be useful for bug reports).
http://www.gazhoo.com/upload/document/2011/05/07/20110507170...
http://rtphoto.co.uk/tomflaherty/pyramid.pdf#best-memo-youll...
It's great for gists with html/js that you want people to preview, as in: http://bl.ocks.org/4331769
In fact, if anyone else is interested in forking the code and experimenting with it, feel free to fork my plunk and go to town:
http://plnkr.co/edit/49fOC5Mq3bcBysKfdPor?p=preview
(Hope you appreciate the irony of forking scratchpad.io via Plunker. Also, it'd be wicked if Plunker could automatically "fork" html webpages, pull in all the required resources and/or updating path references).
Because of this, I found it worthwhile to burn 1-2 hours to de-minify his Javascript, which mostly required figuring out what all his inlined JS libs are.
https://gist.github.com/4321959
To save you a click, here are the JS files he uses:
https://github.com/EightMedia/hammer.js/blob/master/jquery.h...
http://code.google.com/p/rangyinputs/source/browse/trunk/jqu...
https://github.com/jeresig/jquery.hotkeys/blob/master/jquery...
https://github.com/EightMedia/hammer.js/blob/master/hammer.j...
Modified version of http://code.google.com/p/jquery-elastic/source/browse/trunk/...
http://code.google.com/p/webapptools/source/browse/trunk/wat...
https://github.com/coreyti/showdown/blob/master/src/showdown...
https://github.com/coreyti/showdown/blob/master/src/extensio...
https://github.com/coreyti/showdown/blob/master/src/extensio...
https://github.com/coreyti/showdown/blob/master/src/extensio...
http://sharejs.org/channel/bcsocket.js
Related discussion: http://stackoverflow.com/questions/11456558/markdown-not-ren...
I'm worried about accessibility.
Most of the time tabs are used to navigate between fields, so it'd be cool if this was "opt-in", eg entering the textarea would render an icon to click that enabled this feature. Or at least some way to tell the user that pressing the ESCAPE key is how you should tab-out of the field.
Some random ideas I have about it (since it's easier to talk about stuff than to build it): * Your quotes are all from famous books and movies, and you have affiliate links to Amazon... brilliant! * Do you have a mechanism that minimizes repetition? * Do you ever need to fake competition? * Could you visualize mistakes as crashes, to keep things exciting? * Consider making a keyboard UI for the site (Although I use vimium) * Build a mechanism to challenge your friends. * Analyze history and plot it. Take into account difficulty of paragraphs (come up with difficulty rating based on your user data). * Give typing tips; perhaps it's enough to analyze words that the user mistyped, and offer them more passages with them. * Improve the CSS. The UI should reflect the incredibly high level of polish in the gameplay.
Maybe I'll have more random ideas when I play it tomorrow. ;)
A year ago I hacked together an almost trivial Folder Action Script that does the same thing, and works really well. In case anyone's interested, here it is:
Also I didn't realize backspace was supported.
Aside from that, fun little game, well done!