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
#!/bin/bash | |
# Put this in .git/hooks/pre-push | |
# Exit immediately if any command fails | |
set -e | |
echo "Running pre-push checks..." | |
# Get the list of files to be pushed |
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
;; Look & feel | |
;; =========== | |
(setq inhibit-startup-message t) | |
(scroll-bar-mode -1) | |
(tool-bar-mode -1) | |
(tooltip-mode -1) | |
(set-fringe-mode 10) | |
(menu-bar-mode -1) | |
(setq visible-bell t) | |
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") |
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
{ | |
"coc.preferences.useQuickfixForLocations": true, | |
"coc.preferences.extensionUpdateCheck": "never", | |
"suggest.disableMenu": true, | |
"suggest.snippetIndicator": "", | |
"workspace.workspaceFolderCheckCwd": false, | |
"workspace.bottomUpFiletypes": ["python"] | |
} |
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
" Basic config | |
set encoding=utf-8 | |
syntax enable | |
set noswapfile | |
set scrolloff=7 | |
filetype plugin on | |
let mapleader = "," | |
" Basic config - Python specific | |
set tabstop=4 |
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
" vim-bootstrap | |
"***************************************************************************** | |
"" Vim-PLug core | |
"***************************************************************************** | |
let vimplug_exists=expand('~/.vim/autoload/plug.vim') | |
let g:vim_bootstrap_langs = "html,javascript,python,typescript" | |
let g:vim_bootstrap_editor = "vim" " nvim or vim |
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
# Se coloca el inicio de la ejecucion en start_request() | |
class Foo(Spider): | |
name = 'foo' | |
allowed_domains = ['foo.com'] | |
def start_requests(self): | |
while True: | |
data = self.coll.find({'status': 'unscraped'}).limit(5000) | |
if not 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
import scrapy | |
from scrapy.crawler import CrawlerProcess | |
class MySpider1(scrapy.Spider): | |
# Your first spider definition | |
# por ejemplo, obtencion de las paginas correspondientes a un target | |
... | |
class MySpider2(scrapy.Spider): | |
# Your second spider definition |
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
def handle_error(self, failure): | |
self.log("Error Handle: %s" % failure.request) | |
self.log("Sleeping 60 seconds") | |
time.sleep(60) | |
url = 'http://www.google.com' | |
yield scrapy.Request(url, self.parse, errback=self.handle_error, dont_filter=True) |
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
db.test.ensureIndex({name: 1, nodes: 1}, {unique: true, dropDups: true}) |