This file contains 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 strict'; | |
export default function fileReader($q) { | |
'ngInject'; | |
return { | |
restrict: 'E', | |
scope: { | |
label: '@', | |
accept: '@', | |
maxSize: '@', |
This file contains 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
from django.db.models import QuerySet, Manager | |
class BaseRankManager(Manager): | |
def rank(self, field_name, user_id, **kwargs): | |
""" | |
Gets unique items from the datebase based on the foreign key. this | |
queryset is ordered in reverse chronological order. | |
Args: |
This file contains 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
CREATE VIEW "lineitems_vista" AS | |
SELECT | |
id, | |
created_at, | |
updated_at, | |
shift_id, | |
itms.name as name, | |
quantity, | |
transaction_id, | |
itms.price as unit_price, |
This file contains 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
CREATE CONSTRAINT ON (n:Address) ASSERT n.node_id IS UNIQUE; | |
CREATE CONSTRAINT ON (n:Officer) ASSERT n.node_id IS UNIQUE; | |
CREATE CONSTRAINT ON (n:Entity) ASSERT n.node_id IS UNIQUE; | |
CREATE CONSTRAINT ON (n:Intermediary) ASSERT n.node_id IS UNIQUE; | |
USING PERIODIC COMMIT | |
LOAD CSV WITH HEADERS FROM "file:///Addresses.csv" AS line | |
CREATE (n:Address {node_id: line.node_id }) | |
SET n += line; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 exec('ALTER TABLE ' || quote_ident(s.nspname) || '.' || quote_ident(s.relname) || ' OWNER TO rds_superuser;') | |
FROM ( | |
SELECT nspname, relname | |
FROM pg_class c JOIN pg_namespace n ON (c.relnamespace = n.oid) | |
WHERE nspname in ('tiger','topology') AND | |
relkind IN ('r','S','v') ORDER BY relkind = 'S') | |
s; |
This file contains 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 variables in .bashrc file | |
# don't forget to change your path correctly! | |
export GOPATH=$HOME/golang | |
export GOROOT=/usr/local/opt/go/libexec | |
export PATH=$PATH:$GOPATH/bin | |
export PATH=$PATH:$GOROOT/bin |
This file contains 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
# urls.py | |
url(r'partials/(?P<template_name>.+\.html?$)', PartialView.as_view()), | |
# views.py | |
class PartialView(TemplateView): | |
def get_template_names(self): | |
template_name = 'partials/' + self.kwargs['template_name'] | |
return [template_name] |
This file contains 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
[root@zimbra ~]# dig zimbra.debugger.pk any | |
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.6 <<>> zimbra.debugger.pk any | |
;; global options: printcmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43483 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0 | |
;; QUESTION SECTION: | |
;zimbra.debugger.pk. IN ANY |