This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# use this if you want to include modules from a subfolder | |
# | |
__ = os.path.abspath(sys.argv[0]) | |
while os.path.dirname(__) != __: | |
if os.path.exists(os.path.join(__, 'common', '__init__.py')): | |
sys.path.insert(0, __) | |
break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schema = Schema( | |
{ | |
'rovi_data_dir': | |
And( | |
And( | |
os.path.exists, | |
os.path.isdir, | |
lambda s: os.access(s, os.R_OK), | |
error="The path to rovi data '%s' should be an existing directory and be readable. Please check" % arguments['<rovi_data_dir>'] | |
), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/pgsql-9.3/bin/pg_dump -U <user_name> -d <db_name> -f <backup_file>.sql -h <db_host> | |
/usr/pgsql-9.3/bin/psql -U <user_name> -d <db_name> -f <backup_file>.sql -h <db_host> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP FUNCTION IF EXISTS get_image_records( BIGINT ) CASCADE; | |
CREATE OR REPLACE FUNCTION | |
get_image_records(input_program_id BIGINT) | |
RETURNS SETOF JSON STABLE | |
AS $$ | |
BEGIN | |
RETURN QUERY | |
WITH T2 AS ( | |
SELECT | |
file_url :: TEXT, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " must be the first line | |
filetype on | |
filetype indent on | |
filetype plugin on | |
set laststatus=2 | |
syntax on | |
set cursorline | |
set statusline=%<%f\%h%m%r%=%-20.(line=%l\ \ col=%c%V\ \ totlin=%L%)\ \ \%h%m%r%=%-40(bytval=0x%B,%n%Y%)\%P | |
" Allow saving of files as sudo when I forgot to start vim using sudo. | |
cmap w!! w !sudo tee > /dev/null % |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH T1 AS ( | |
SELECT | |
program_id, | |
ARRAY [alias_title, | |
alias_title_2, | |
alias_title_3, | |
alias_title_4] AS title_array | |
FROM movies | |
), | |
T2 AS ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP FUNCTION IF EXISTS remove_all(); | |
CREATE FUNCTION remove_all() RETURNS void AS $$ | |
DECLARE | |
rec RECORD; | |
cmd text; | |
BEGIN | |
cmd := ''; | |
FOR rec IN SELECT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RAISE LOG 'Calculated income for user % is %', user.id, user.income; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
sudo: yes | |
tasks: | |
- name: install the EPEL and remi repos | |
yum: name={{item}} | |
state=installed | |
with_items: | |
- http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
- http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select array_agg(value) from jsonb_each_text('{"3d": "2011-05-20", "wide": "2011-05-20", "imax_3d": "2011-05-20"}'::jsonb); |