Skip to content

Instantly share code, notes, and snippets.

View lardissone's full-sized avatar

Leandro Ardissone lardissone

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
TypeError: Cannot read property 'getBufferPosition' of undefined
at TextEditor.module.exports.TextEditor.getCursorBufferPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1235:34)
at status-bar-cursor.CursorPositionView.updatePosition (/Applications/Atom.app/Contents/Resources/app/node_modules/status-bar/lib/cursor-position-view.js:48:73)
at status-bar-cursor.CursorPositionView.subscribeToActiveTextEditor (/Applications/Atom.app/Contents/Resources/app/node_modules/status-bar/lib/cursor-position-view.js:39:19)
at /Applications/Atom.app/Contents/Resources/app/node_modules/status-bar/lib/cursor-position-view.js:17:24
at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:71:11)
at /Applications/Atom.app/Contents/Resources/app/src/pane-container.js:285:34
at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:71:11)
at Pane.module.exports
@lardissone
lardissone / instagram.ipynb
Created February 9, 2015 22:21
Instagram scrapper
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class Author(models.Model):
name = models.CharField(max_length=200)
class Book(models.Model):
title = models.CharField(max_length=200)
author = models.ForeignKey(Author)
# here it is:
# this should start from 1 for the same author
# examples:
# author1 | 1
module.exports = exports = function relativeImageUrl(schema, options) {
var relField = options.relativeUrlField || 'relUrl',
field = {};
field[relField] = String;
schema.add(field);
schema.pre('save', function(next) {
var photoField = options.absoluteUrlField || 'large',
removeStr = process.env.PWD + '/client',
/*
Theme Name: Breeze theme
Theme URI:
Description:
Version: 1.0
Author: Freshout
Tags:
*/
@lardissone
lardissone / contacts.php
Created October 16, 2010 20:31
Access Google Contacts
<?php
/************************
* Google Contact importer
*
* Asks for permissions to provide access to your Gmail/Google contacts
* to the given site.
*************************/
// include all required components from Zend Gdata
// from: http://framework.zend.com/download/gdata
@lardissone
lardissone / gist:630248
Created October 16, 2010 20:43
Generate Private Certificates and Keys
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -sha1 -subj '/C=US/ST=CA/L=Mountain View/CN=yourdomain.com' -keyout myrsakey.pem -out myrsacert.pem
@lardissone
lardissone / gist:633091
Created October 18, 2010 21:23
Center element on screen
jQuery.fn.center = function () {
this.css("position","absolute");
this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
return this;
}
@lardissone
lardissone / smtpd.sh
Created December 17, 2010 18:23
SMTP development server in Python
python -m smtpd -n -c DebuggingServer localhost:1025