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.http import HttpResponse | |
from tastypie import http | |
from tastypie.exceptions import ImmediateHttpResponse | |
from tastypie.resources import convert_post_to_put | |
class PublicEndpointResourceMixin(object): | |
""" Public endpoint dispatcher, for those routes upon which you don't want | |
to enforce the current resources authentication limits.""" |
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
class ProfileResource(ModelResource): | |
user = fields.ForeignKey(UserResource, 'user') | |
def prepend_urls(self): | |
urls = [ | |
url(r'^(?P<resource_name>%s)/(?P<username>[\w\d_.-]+)/$' %\ | |
self._meta.resource_name, self.wrap_view('user_by_username'), | |
name='profile_user_by_username') | |
] | |
return urls |
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
MASTER=`git log --pretty=format:'%H' develop | sort` | |
DEV=`git log --pretty=format:'%H' feature/uiv2-develop | sort` | |
for i in `diff <(echo "${MASTER}") <(echo "${DEV}") | grep '^>' | sed 's/^> //'`; | |
do | |
git --no-pager log -1 --oneline $i; | |
done |
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
angular.module('ngApp') | |
.service('modalService', ['$modal', | |
function ($modal) { | |
// Default options for Modal window Options | |
var modalOptions = { | |
closeButtonText: 'Close', | |
actionButtonText: 'OK', | |
headerText: 'Proceed?', | |
bodyText: 'Perform this action?', | |
value: {}, |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
''' | |
AWS S3 Gzip compression utility | |
Author: Dmitriy Sukharev | |
Modified: 2013-09-11 | |
------- | |
Synchronizes directory with gzipped content of Amazon S3 bucket with local |
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
#!/bin/bash | |
while read oldrev newrev ref | |
do | |
if [[ $ref =~ .*/master$ ]]; | |
then | |
echo "Master ref received. Deploying master branch to production..." | |
git --work-tree=/home/ubuntu/node-frankly --git-dir=/home/ubuntu/development checkout -f | |
changedfiles=( `git diff-tree --no-commit-id --name-only master` ) |
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
/* | |
* Calaca - Search UI for Elasticsearch | |
* https://github.com/romansanchez/Calaca | |
* http://romansanchez.me | |
* @rooomansanchez | |
* | |
* v1.2.0 | |
* MIT License | |
*/ |
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
/*global PushStream WebSocketWrapper EventSourceWrapper EventSource*/ | |
/*jshint evil: true, plusplus: false, regexp: false */ | |
/** | |
The MIT License (MIT) | |
Copyright (c) 2010-2014 Wandenberg Peixoto <[email protected]>, Rogério Carvalho Schneider <[email protected]> | |
This file is part of Nginx Push Stream Module. | |
Permission is hereby granted, free of charge, to any person obtaining a copy |
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 json_build_object( | |
'total', (SELECT n_live_tup FROM pg_stat_user_tables WHERE relname='sometable'), | |
'count', count(sometable_rows.*), | |
'offset', 0, | |
'results', json_agg(row_to_json(sometable_rows)) | |
) | |
FROM (SELECT * FROM test_log_clj) | |
ORDER BY "time" | |
LIMIT 10 OFFSET 0) | |
sometable_rows; |
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
pid logs/nginx.pid; | |
error_log logs/nginx-main_error.log debug; | |
# Development Mode | |
master_process off; | |
daemon off; | |
worker_rlimit_core 2500M; | |
working_directory /tmp; | |
debug_points abort; | |
env MOCKEAGAIN_VERBOSE; |
OlderNewer