Using Requests and Beautiful Soup, with the most recent Beautiful Soup 4 docs.
Install our tools (preferably in a new virtualenv):
pip install beautifulsoup4
| urlencode() { | |
| # urlencode <string> | |
| old_lc_collate=$LC_COLLATE | |
| LC_COLLATE=C | |
| local length="${#1}" | |
| for (( i = 0; i < length; i++ )); do | |
| local c="${1:$i:1}" | |
| case $c in |
| To remove a submodule you need to: | |
| Delete the relevant line from the .gitmodules file. | |
| Delete the relevant section from .git/config. | |
| Run git rm --cached path_to_submodule (no trailing slash). | |
| Commit and delete the now untracked submodule files. |
Using Requests and Beautiful Soup, with the most recent Beautiful Soup 4 docs.
Install our tools (preferably in a new virtualenv):
pip install beautifulsoup4
| #!/usr/bin/env python | |
| """ | |
| Very simple HTTP server in python (Updated for Python 3.7) | |
| Usage: | |
| ./dummy-web-server.py -h | |
| ./dummy-web-server.py -l localhost -p 8000 | |
| Send a GET request: |
| ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json" |
| #!/bin/bash | |
| # A simple script to backup an organization's GitHub repositories. | |
| #------------------------------------------------------------------------------- | |
| # NOTES: | |
| #------------------------------------------------------------------------------- | |
| # * User @jimklimov (and probably some others called out in the long comment | |
| # thread below) have modified this script to make it more robust and keep | |
| # up with various changes in the GitHub API and response format at: | |
| # https://github.com/jimklimov/github-scripts |
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: stud | |
| # Required-Start: $remote_fs $network $local_fs | |
| # Required-Stop: $remote_fs $network $local_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: The Scalable TLS Unwrapping Daemon | |
| # Description: stud is a network proxy that terminates TLS/SSL |
| var redis = require("redis") | |
| , subscriber = redis.createClient() | |
| , publisher = redis.createClient(); | |
| subscriber.on("message", function(channel, message) { | |
| console.log("Message '" + message + "' on channel '" + channel + "' arrived!") | |
| }); | |
| subscriber.subscribe("test"); |
| /** | |
| * Single-line text, horizontally scrollable | |
| */ | |
| output | |
| { | |
| display: block; | |
| font-size: 2em; | |
| width: 20em; | |
| overflow-y: hidden; |
| # https://gist.github.com/eric1234/7324795 | |
| # Make sure git is installed | |
| apt-get install -y git | |
| # Remove functions that phpsh needs from config. | |
| sed -i 's/pcntl_signal,//g' /etc/php5/cli/php.ini | |
| sed -i 's/pcntl_fork,//g' /etc/php5/cli/php.ini | |
| sed -i 's/pcntl_wait,//g' /etc/php5/cli/php.ini |