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
import sys | |
import json | |
import argparse | |
from os.path import exists | |
from pprint import pprint | |
from urllib import urlencode, urlretrieve | |
from urllib2 import urlopen | |
from urlparse import urlsplit, parse_qs |
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
class PartialResponse(object): | |
""" Downloader middleware to only return the first n bytes | |
""" | |
def process_response(self, request, response, spider): | |
max_size = getattr(spider, 'response_max_size', 0) | |
if max_size and len(response.body) > max_size: | |
h = response.headers.copy() | |
h['Content-Length'] = max_size | |
response = response.replace( | |
body=response.body.encode('utf-8')[:max_size], |
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
#!/bin/bash | |
if [ -n "$1" ]; then | |
TARGET="$1" | |
else | |
TARGET="." | |
fi | |
# Remove Python compiled bytecode files | |
command="find $TARGET -name '*.pyc' -type f -delete -print 2>/dev/null"; |
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
#!/bin/bash | |
if [ `expr index "$1" "\+"` = 0 ]; then | |
PATTERN="*$1*" | |
else | |
#PATTERN="$1" | |
PATTERN="${1/+/*}" | |
fi | |
if [ -n "$2" ]; then |
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
mpv --input-test --force-window --idle | |
mpv --input-keylist | |
mpv --list-options | |
Keyboard | |
r and t | |
Move subtitles up/down |
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
# mpv keybindings | |
# | |
# Location of user-defined bindings: ~/.config/mpv/input.conf | |
# | |
# Lines starting with # are comments. Use SHARP to assign the # key. | |
# Copy this file and uncomment and edit the bindings you want to change. | |
# | |
# List of commands and further details: DOCS/man/input.rst | |
# List of special keys: --input-keylist | |
# Keybindings testing mode: mpv --input-test --force-window --idle |
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
# | |
# Example mpv configuration file | |
# | |
# Warning: | |
# | |
# The commented example options usually do _not_ set the default values. Call | |
# mpv with --list-options to see the default values for most options. There is | |
# no builtin or example mpv.conf with all the defaults. | |
# | |
# |
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
/* | |
usbreset -- send a USB port reset to a USB device | |
http://askubuntu.com/questions/645#answer-661 | |
cc usbreset.c -o usbreset | |
lsusb |grep DUB | |
Bus 001 Device 021: ID 2001:1a02 D-Link Corp. DUB-E100 Fast Ethernet Adapter(rev.C1) [ASIX AX88772] |
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
""" pipelines.py """ | |
import collections | |
import scrapy | |
import scrapy.contrib.exporter | |
import myproject | |
class SitemapPipeline(object): | |
""" | |
Sitemap builder |
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
<div id="app"> | |
<v-app> | |
<v-navigation-drawer | |
persistent | |
:mini-variant="miniVariant" | |
:clipped="clipped" | |
v-model="drawer" | |
> | |
<v-list> | |
<v-list-item |