Ranger mac setup:
- brew install ranger
- ranger --copy-config=all
- vim ~/.config/ranger/rc.conf
- preview_image false --> true
Other Tools:
- brew install w3m
- brew install lynx
import os | |
def main(): | |
'''Stupidly simple script to rename all files to the name of their | |
parent_dir directory. | |
Warning: Be careful when running, this could be bad... Also | |
make sure your current directory doesn't have anything in | |
it but folders. Otherwise they'll get renamed to ..extention |
''' | |
Simple class for counting number of occurances in each of the given ranges. | |
''' | |
class RangeCounter(object): | |
def __init__(self, range_list): | |
# Verify range is sorted | |
self.range_list = sorted(range_list) | |
self.counter = [0] * (len(range_list) + 1) | |
def add(self, view_count): |
# -*- coding: utf-8 -*- | |
import argparse | |
import gzip | |
import logging | |
import logging.config | |
import os | |
import sys | |
import zipfile | |
logger = logging.getLogger(__name__) |
# -*- coding: utf-8 -*- | |
''' | |
Quick script to embed into Automator to concat a folder of srt files into | |
a single srt. | |
Note: This also removes extra blanks lines, to allow pycaption to process | |
the files. This won't be needed if https://github.com/pbs/pycaption/pull/39 | |
is merged. | |
''' |
# encoding: utf-8 | |
from __future__ import unicode_literals | |
import os | |
import requests | |
import sys | |
def get_google_auth_session(username, password): | |
session = requests.Session() |
Ranger mac setup:
Other Tools:
description "Hubot Slack bot" | |
# Slack-specific environment variables. Change these: | |
env HUBOT_SLACK_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaa | |
env HUBOT_SLACK_TEAM=example | |
env HUBOT_SLACK_BOTNAME=flash_gordan | |
env HUBOT_AUTH_ADMIN=admin | |
# Subscribe to these upstart events | |
# This will make Hubot start on system boot |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import json | |
import logging | |
import logging.handlers | |
import requests | |
class BufferingSlackWebHookHandler(logging.handlers.BufferingHandler): |
''' | |
Quick and dirty code to see if I could figure out the next | |
larger number with all the same digits of the number passed. | |
Note: After coming up with the solution I found the following | |
http://stackoverflow.com/questions/9368205/given-a-number-find-the-next-higher-number-which-has-the-exact-same-set-of-digi | |
''' | |
def get_next(the_num): | |
the_num = str(the_num) |
from flask import Blueprint | |
shared_value = None | |
class RegisteringExampleBlueprint(Blueprint): | |
''' | |
Example showing how to access a value for routes | |
saved in flask's configuration section for all routes in | |
blueprint. | |