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
➜ ~ curl -X POST -d '{"username":"[email protected]", "password":"password1" }' -H 'Content-Type: application/json' https://mmdb-staging.nationalgeographic.com/api/v1/auth/login/ -i -c mmdbsessionid -v -1 | |
* About to connect() to mmdb-staging.nationalgeographic.com port 443 (#0) | |
* Trying 74.217.81.189... connected | |
* successfully set certificate verify locations: | |
* CAfile: none | |
CApath: /etc/ssl/certs | |
* SSLv3, TLS handshake, Client hello (1): | |
* SSLv3, TLS handshake, Server hello (2): | |
* SSLv3, TLS handshake, CERT (11): | |
* SSLv3, TLS handshake, Server finished (14): |
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
# This was modified from the original version posted here: | |
# | |
# http://www.carthage.edu/webdev/?p=12 | |
# | |
# ... retrieved around 1/12/2008. | |
# | |
# Modifications include: | |
# | |
# 1. Using a simple bind for auth instead of a search | |
# 2. Upping the default privileges for users |
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
-- Create a simple node | |
MERGE (actor:test_article { aid:"112"}) | |
ON CREATE SET actor.created = timestamp(), actor.api = "api", actor.type = "test_article" | |
-- Create activities | |
MERGE (actor:test_user { aid:"110"}) | |
ON CREATE SET actor.created = timestamp(), actor.api = "api", actor.type = "test_user" | |
ON MATCH SET actor.updated = timestamp() |
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
$ telnet 127.0.0.1 11211 | |
Trying 127.0.0.1... | |
Connected to 127.0.0.1. | |
Escape character is '^]'. | |
flush_all | |
OK | |
quit | |
Connection to localhost closed by foreign 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
<script type="text/javascript" src="whatever.js"></script> | |
<script type="text/javascript"> | |
(function(s){ | |
s = s[s.length - 2]; | |
s.src = s.src + '?bustcache=' + new Date().getTime(); | |
})(document.getElementsByTagName('script')); | |
</script> |
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
$.fn.pageMe = function (opts) { | |
var $this = this, | |
defaults = { | |
perPage: 7, | |
showPrevNext: false, | |
hidePageNumbers: false | |
}, | |
settings = $.extend(defaults, opts); | |
var listElement = $this; |
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
$.urlParam = function(href, name){ | |
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(href); | |
return results[1] || 0; | |
}; |
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
# -*- Mode: Shell-Script -*- Not really, but shows comments correctly | |
# $Id: ipythonrc,v 1.4 2003/05/16 06:53:42 fperez Exp $ | |
#*************************************************************************** | |
# | |
# Configuration file for IPython -- ipythonrc format | |
# | |
# The format of this file is simply one of 'key value' lines. | |
# Lines containing only whitespace at the beginning and then a # are ignored | |
# as comments. But comments can NOT be put on lines with data. |
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
// Add this file to your admin class throught class Media. | |
(function($) { | |
// Add the extra querystring to the autolookup field. | |
function update_lookup_querystring(obj_id) { | |
id = $("#" + obj_id).val(); | |
$("[id^=lookup_id_linea_set-]").each(function( index ) { | |
var original_href = $(this).attr('href').split('&')[0]; | |
$(this).attr('href', original_href + '&' + obj_id + '=' + id); | |
}); | |
} |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |