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
# post_loc.txt contains the json you want to post | |
# -p means to POST it | |
# -H adds an Auth header (could be Basic or Token) | |
# -T sets the Content-Type | |
# -c is concurrent clients | |
# -n is the number of requests to run in the test | |
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |
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
/** | |
* | |
*/ | |
module.exports = function(grunt) { | |
var timestamp = new Date().getTime() + ''; | |
var pkg = grunt.file.readJSON('package.json'); | |
// 1. All configuration goes here |
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
var node = Util.getSelectionStart() | |
var text = p.childNodes[0]; | |
var at = 5; | |
// create new span node with content | |
var span = document.createElement("span"); | |
span.appendChild(document.createTextNode('ipsum')); | |
// Split the text node into two and add new span | |
p.insertBefore(span, text.splitText(at)); |
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
<svg xmlns="SVG namespace" width="600" height="250"> | |
<g stroke-width="16" fill="none"> | |
<path d="M173 102a51 51 0 1 1-13-30m20 37h-53" stroke="#4a87ee"/> | |
<circle cx="227" cy="128" r="32" stroke="#d83038"/> | |
<circle cx="313" cy="128" r="32" stroke="#f4c022"/> | |
<path d="M401 160a31 31 0 1 1 0-61m-4 0a24 29 0 1 1 0 61m26-67v79m-1-12a20 20 0 1 1-52 17" stroke="#4a87ee"/> | |
<path stroke="#4ab95a" d="M449 51v115"/> | |
<path d="M529 118a30 30 0 1 0-2 24m5-32l-62 28" stroke="#d83038"/> | |
</g> |
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
EVAL "for i, name in ipairs(redis.call('KEYS', 'author_*')) do redis.call('expire', name, 0); end" 0 |
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
/* | |
var model = new BackboneModel({ | |
key : value | |
}) | |
model.add("key", "value") | |
model.listen("key", function(){ | |
}) | |
*/ |
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
source ~/.bash_settings/.paths | |
#export PATH="/usr/local/Cellar/postgresql/9.2.3/bin/:$PATH" | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" | |
source ~/.bash_settings/.bash_pretty | |
source ~/.bash_settings/.aliases | |
# {{{ | |
# Node Completion - Auto-generated, do not touch. |
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
events.js:72 | |
throw er; // Unhandled 'error' event | |
^ | |
Error: Parse Error | |
at Socket.socketOnData (http.js:1583:20) | |
at TCP.onread (net.js:525:27) | |
4 Apr 03:41:51 - [nodemon] app crashed - waiting for file changes before starting... | |
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
posts.adminFeed = function(req, res, next) { | |
var perPage = 10 | |
, page = req.params.page > 0 ? req.params.page : 0; | |
console.log("looking for admin feed ************************"); | |
var query = req.query.from; | |
Post | |
.find(req.query) |
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
/** | |
* | |
*/ | |
var _ = require('underscore') | |
, async = require('async'); | |
function originalFilter(actionHandler) { | |
return function () { | |
actionHandler.apply(this, arguments); |