It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
brew install ImageMagick
ffmpeg -ss 14:55 -i video.mkv -t 5 -s 480x270 -f image2 %04d.png
- -ss 14:55 gives the timestamp where I want FFmpeg to start, as a duration string.
- -t 5 says how much I want FFmpeg to decode, using the same duration syntax as for -ss.
- -s 480x270 tells FFmpeg to resize the video output to 480 by 270 pixels.
- -f image2 selects the output format, a series of still images — make sure there are leading zeros in filename.
https://github.com/rails-api/active_model_serializers
- Customize fields to be serialized to json
In celebration of Whyday: Rubyists always want to show others the beautiful code | |
they have created, hence the question: Has Anybody Seen My Code? | |
Has Anybody Seen My Code | |
(sung to the tune of Has Anybody Seen My Gal) | |
Clean and small, works for all, | |
Ruby is my all in all. | |
Has anybody seen my code? |
- Related Setup: https://gist.github.com/hofmannsven/6814278
- Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
- Interactive Beginners Tutorial: http://try.github.io/
- Git Cheatsheet by GitHub: https://services.github.com/on-demand/downloads/github-git-cheat-sheet/
Press minus + shift + s
and return
to chop/fold long lines!
# encoding: utf-8 | |
require 'mechanize' | |
require 'csv' | |
START_URL = 'http://www.confreaks.com/events' | |
STDOUT.sync = true | |
agent = Mechanize.new | |
page = agent.get START_URL |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
(From this thread: https://twitter.com/unclebobmartin/status/326189060311891970)
Abby is talking about speed of feedback. Why would we invest in something high quality if we have no idea if it is going to work? In the Agile world, Fast in exchange for Quality certainly does appear - we just call it "Prototypes" or "Spikes". Those are specifically designed to eliicit feedback without spending a ton of time on a solution we may or may not need.
Lean Startup principles take that a bit further - build something quickly to get feeback so that you know if the direction you are going in is the right one. That gives you customer feedback - and dollars - to be able to build a high quality solution. If something has bugs or doesn't work correctly for all cases, who cares if we are directing people only down one path to see how they respond to the system?
Like spikes, it has the danger of turning into the final product, at which point quality is a big concern. But I see no problem with advising customers who are tryi