Skip to content

Instantly share code, notes, and snippets.

View delucas's full-sized avatar

Lucas Videla delucas

  • Buenos Aires, Argentina
View GitHub Profile

This document has moved!

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.

@delucas
delucas / postgres_queries_and_commands.sql
Last active July 21, 2016 20:07 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- 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%'
@protrolium
protrolium / terminal-gif.md
Last active February 15, 2024 09:09
convert images to GIF in Terminal

Install ImageMagick

brew install ImageMagick

Pull specific region of frames from video file w/ ffmpeg

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.
@david-crowell
david-crowell / Gems.md
Last active February 24, 2017 15:54
Gems for gem lecture
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
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?
@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet
# 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
@willurd
willurd / web-servers.md
Last active May 4, 2024 07:22
Big list of http static server one-liners

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.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@CoryFoy
CoryFoy / gist:5434811
Created April 22, 2013 13:17
Speed vs Quality vs Feedback

(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