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/sh | |
if [ -z "$1" -o -z "$2" ]; then | |
echo "Usage: $0 URL SEASON" >&2 | |
exit 1 | |
fi | |
SHOW_ID=`python3 -c 'from urllib.parse import urlparse, parse_qs;from sys import argv;print(parse_qs(urlparse(argv[1]).query)["p"][0])' "$1"` | |
SHOW_URL="http://gdata.youtube.com/feeds/api/shows/$SHOW_ID/content?v=2&alt=json" | |
SEASON="$2" |
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
#Add client credentials | |
pykoauth2 addclient facebook.com CLIENT_ID CLIENT_SECRET | |
#Make authorization request (starts web server at http://localhost:8080 and prints URL. Point your web browser to this URL) | |
pykoauth2 authcode facebook.com | |
#Get access token | |
pykoauth2 token --server_fqdn facebook.com | |
#Make authenticated request | |
pykoauth2curl --data-urlencode 'message=Hello world from pykoauth2!' \ | |
'https://graph.facebook.com/me/feed' |
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
--------------------------------------------------------------------------- | |
PicklingError Traceback (most recent call last) | |
C:\Users\pyokagan\<ipython-input-5-846925efa119> in <module>() | |
9 #Wrap all Client Credentials! | |
10 cwrap.wrap_authorization_server_database(context.authorization_servers, client_db) | |
---> 11 args.func(args) | |
C:\Users\pyokagan\<ipython-input-2-7bd01ceccacc> in authcode(args) | |
19 redirect_uri = args.redirect_uri |
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
Imports BouncyBoar3 | |
Namespace MyGame | |
Namespace Nodes | |
''' <summary> | |
''' | |
''' </summary> | |
''' <remarks> |
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 | |
#Transfers files in one direction | |
usage="$0 remote dest" | |
if [[ !( -n $1 ) || !( -n $2 ) ]]; then | |
echo $usage >&2 | |
exit 2 | |
fi |
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 | |
if [ -z $1 ]; then | |
echo "usage: $0 URL" >&2 | |
exit 1 | |
fi | |
playlistid="$(sed -n 's|https://www\.youtube.com/playlist?list=PL\([A-Z0-9]*\)|\1|p' <<< $1)" | |
if [ -z "$playlistid" ]; then | |
echo "Invalid URL" >&2 | |
exit 1 |
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
#! /usr/bin/python2.6 | |
#NOTE: Also python3 compatible. | |
from __future__ import print_function,unicode_literals | |
import time, json, sys, re | |
from argparse import ArgumentParser | |
from telnetlib import Telnet | |
class Mozrepl: | |
def __init__(self, host="127.0.0.1", port=4242): | |
self.host = host |
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
#! /usr/bin/python2.6 | |
""" | |
trunc -n LENGTH -k 0,1,2,3... COMPONENTS... | |
""" | |
from __future__ import print_function,unicode_literals | |
from argparse import ArgumentParser | |
from math import floor | |
def shorten(length, x, suffix = "..."): | |
if len(x) <= length: |
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
#! /usr/bin/python3 | |
"""Converts a list of code files into a latex document.""" | |
from argparse import ArgumentParser | |
import re | |
import os | |
from pygments.lexers import get_lexer_for_filename | |
def filter_tex(x): | |
def escape(x): |
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
#! /usr/bin/python3 -u | |
"""A wrapper around oauth2curl. Makes multiple | |
calls to oauth2curl. Returns items one item | |
per line.""" | |
from argparse import ArgumentParser | |
from subprocess import Popen, PIPE | |
import sys | |
from urllib.parse import urlsplit, parse_qs, urlencode, urlunsplit | |
import json | |
import signal |
OlderNewer