Skip to content

Instantly share code, notes, and snippets.

@artem-a
artem-a / shell.sh
Created March 30, 2018 08:19
Outputting select SQL into file
echo 'select * from table ' | psql database_name >> result.txt
cat query.sql | psql database_name >> result.txt
@artem-a
artem-a / query.sql
Last active March 30, 2018 08:08
Find duplicate values with SQL
select * from tb as t1
where (select count(1) from tb as t2 where t1.column ilike t2.column) > 1
order by column;
@artem-a
artem-a / Key Bindings User
Last active January 29, 2016 13:49
Sublime Text 3 settings for Ruby
[
{ "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["alt+shift+down"], "command": "select_lines", "args": {"forward": true} },
{ "keys": ["ctrl+alt+m"], "command": "toggle_menu" }
]
@artem-a
artem-a / punchcard.js
Last active March 30, 2018 08:10
D3 punchcard
var D3punchcard = function(el, options) {
options || (options = {});
var _chart = {};
var _svg = null;
var _this = this;
_this.el = el
_this.data = options.data;
var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];