# Help for @lazylead | |
licence_file_path = "test_licence.txt" | |
file_name_teplate = /.+\.txt$/ | |
dir_path = 'one' | |
puts "Licence file: #{licence_file_path}\nFile name template: #{file_name_teplate.inspect}\nDirpath: #{dir_path}\nLicence text:\n" | |
p licence_text = File.read(licence_file_path) | |
stack = [dir_path] |
This is a wrinkle that people often don't get about the ident
attribute: in CVS or Subversion, it would be legitimate to have a VERSION
file containing nothing but $Id$
as a way of tracking that the right push had happened; if you did that with git, you'd get nothing useful. If you run the script below (or just read it and the output that follows), you can see why.
(Please direct comments on this to https://plus.google.com/+TreyHarris/posts/KRgNG3zDk9x.)
Setting it up in Git is relatively simple. You create (or edit) the file .gitattributes and add a line telling Git to replace $Id$
when found in files that match certain filenames:
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
Key-Type: 1 | |
Key-Length: 2048 | |
Subkey-Type: 1 | |
Subkey-Length: 2048 | |
Name-Real: Root Superuser | |
Name-Email: root@handbook.westarete.com | |
Expire-Date: 0 |
require "active_record" | |
namespace :db do | |
db_config = YAML::load(File.open('config/database.yml')) | |
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'}) | |
desc "Create the database" | |
task :create do | |
ActiveRecord::Base.establish_connection(db_config_admin) |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), 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(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺
Locally, I'm at this commit:
$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date: Sun Apr 15 16:35:03 2012 +0200
When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.