Replace Ruby 1.8 hash syntax in Vim.
%s/([^:]):(\w\w*)\s*=>\s*/\1\2: /g
// remove any password input onpaste events | |
$('input:password[onpaste]').each(function() { | |
$(this).attr('onpaste', ''); | |
}); |
#!/bin/bash | |
printf "\e[8;24;132;t" | |
exit 0 |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'json' | |
def keywords_file | |
ENV['PJKKG'] + '01' | |
end | |
def keywords_line(project) |
"123, 45 6, 7 89".delete(' ').split(',').map(&:to_i) | |
# => [123, 456, 789] |
Replace Ruby 1.8 hash syntax in Vim.
%s/([^:]):(\w\w*)\s*=>\s*/\1\2: /g
drop table if exists `cars`; | |
create table `cars` ( | |
`id` int not null auto_increment, | |
`make` varchar(255), | |
`model` varchar(255), | |
`created_at` timestamp default current_timestamp not null, | |
`updated_at` timestamp default current_timestamp on update current_timestamp not null, | |
primary key (`id`) | |
); |
SELECT | |
NOW() AS 'now', | |
GET_FORMAT(DATE, 'ISO') AS 'format', | |
DATE_FORMAT(NOW(), GET_FORMAT(DATE, 'ISO')) AS 'iso_8601'; | |
+---------------------+----------+------------+ | |
| now | format | iso_8601 | | |
+---------------------+----------+------------+ | |
| 2016-01-11 12:34:56 | %Y-%m-%d | 2016-01-11 | | |
+---------------------+----------+------------+ | |
1 row in set (0.00 sec) |
var date = new Date(); | |
var dateString = [date.getFullYear(), | |
('0' + (date.getMonth() + 1)).slice(-2), | |
('0' + date.getDate()).slice(-2)].join('/'); | |
dateString += ' '; | |
dateString += [('0' + date.getUTCHours()).slice(-2), | |
('0' + date.getUTCMinutes()).slice(-2), | |
('0' + date.getUTCSeconds()).slice(-2)].join(':'); | |
dateString += ' +' + ((date.getTimezoneOffset() / 60) * -100); |
The PFX format is not supported by AWS IAM. Follow the below steps to convert to the correct format (X5.09 PEM) by using OpenSSL.
unzip -j -P password Wildcard\ Completed\ Certificates\ for\ Import.zip
openssl pkcs12 -in wildcard.marlborought.govt.nz_withPK.pfx -nocerts -nodes -passin pass:goodsecret | openssl rsa -out my-private-key.pem