Skip to content

Instantly share code, notes, and snippets.

Maximiliano Cecilia maxicecilia

  • Argentina, Tucuman, San Miguel de Tucuman
Block or report user

Report or block maxicecilia

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@maxicecilia
maxicecilia / login_ok
Last active Aug 29, 2015
Successful login using TLSv1
View login_ok
➜ ~ curl -X POST -d '{"username":"J5ycMY.4cDL7O@fakeuser.com", "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):
View backend.py
# 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
@maxicecilia
maxicecilia / query.sql
Created Dec 19, 2014
Some Neo4j queries
View query.sql
-- 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()
@maxicecilia
maxicecilia / memcached.txt
Created Nov 7, 2014
How to flush memcache & redis
View memcached.txt
$ 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.
@maxicecilia
maxicecilia / bustcache.html
Created Sep 6, 2014
Simply script to avoid cache in js/css files using javascript only.
View bustcache.html
<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>
@maxicecilia
maxicecilia / paginate.js
Created Jun 25, 2014
Quick and simple pagination script. I stole this somewhere... I don't remember where or to whom, so all the credit goes to Chuck Norris.
View paginate.js
$.fn.pageMe = function (opts) {
var $this = this,
defaults = {
perPage: 7,
showPrevNext: false,
hidePageNumbers: false
},
settings = $.extend(defaults, opts);
var listElement = $this;
@maxicecilia
maxicecilia / urlParam.js
Created Apr 25, 2014
Simple method to recover parameter values from a URL
View urlParam.js
$.urlParam = function(href, name){
var results = new RegExp('[\\?&amp;]' + name + '=([^&amp;#]*)').exec(href);
return results[1] || 0;
};
@maxicecilia
maxicecilia / ipythonrc
Created Apr 22, 2014
default ipythonrc example
View ipythonrc
# -*- 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.
@maxicecilia
maxicecilia / autocomplete_extra_query.js
Created Apr 4, 2014
Add an extra query string to Django Grappelli's autolookup fields.
View autocomplete_extra_query.js
// 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);
});
}
@maxicecilia
maxicecilia / 0_reuse_code.js
Created Oct 8, 2013
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.