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/env bash | |
| set -e | |
| TMP=/var/tmp/temp-linecount-repo | |
| git clone --depth 1 "$1" ${TMP} | |
| printf "('${TMP}' will be deleted automatically)\n\n\n" | |
| cloc ${TMP} | |
| rm -rf ${TMP} |
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/env python2 | |
| # https://gist.github.com/ph1ee/58d55a736462cc2f4f2d | |
| from gevent import monkey; monkey.patch_all() | |
| from bottle import route, run, template, request, response | |
| # import simplejson as json | |
| import cv2 | |
| from bottle import debug | |
| debug(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
| #!/usr/bin/env python2 | |
| # https://gist.github.com/ph1ee/58d55a736462cc2f4f2d | |
| from gevent import monkey; monkey.patch_all() | |
| from bottle import route, run, template, request, response | |
| import cv2 | |
| from bottle import debug | |
| debug(True) | |
| CRLF = "\r\n" |
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/env python3 | |
| from __future__ import division, print_function | |
| import multiprocessing as mp | |
| from collections import namedtuple # immutable data class | |
| import time | |
| # data class | |
| Vector = namedtuple('Vector', 'x y z') |
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 | |
| # | |
| # Update a bunch of git repos on command | |
| # | |
| set -e | |
| # get a list of non-hidden directories | |
| shopt -u dotglob |
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
| <!DOCTYPE html> | |
| <html> | |
| <header></header> | |
| <body> | |
| <p>Embed a PDF in an html page</p> | |
| <object width="400" height="400" data="test.pdf"></object> | |
| <iframe src="http://www.google.com" height="400" width="250"></iframe> |
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/env bash | |
| set -e | |
| loc () { | |
| echo "==========================================" | |
| echo " $1" | |
| echo "==========================================" | |
| TMP=/var/tmp/temp-linecount-repo |
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
| # Installs Jupyter Notebook and IPython kernel from the current branch | |
| # Another Docker container should inherit with `FROM jupyter/notebook` | |
| # to run actual services. | |
| # | |
| # For opinionated stacks of ready-to-run Jupyter applications in Docker, | |
| # check out docker-stacks <https://github.com/jupyter/docker-stacks> | |
| # | |
| # build: docker build -t rpi . | |
| # run: docker run -ti -p 8888:8888 -v `pwd`/notebooks:/notebooks rpi /bin/bash | |
| # |
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
| #include <stdio.h> | |
| #include <fcntl.h> // File Control Definitions | |
| #include <termios.h> // POSIX Terminal Control Definitions | |
| #include <unistd.h> // UNIX Standard Definitions | |
| #include <errno.h> // ERROR Number Definitions | |
| #include <sys/ioctl.h> // define both TIOCMBIS and TIOCMBIC | |
| /** References | |
| https://xanthium.in/Serial-Port-Programming-on-Linux | |
| http://xanthium.in/Controlling-RTS-and-DTR-pins-SerialPort-in-Linux |
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/env python2 | |
| # as of this time, pip 10.0.0 has no dependencies as shown by pip show pip | |
| # this should not in any way harm pip, setuptools, or wheel | |
| from __future__ import print_function, division | |
| import sys | |
| import pip | |
| import subprocess | |
| # from subprocess import Popen,PIPE,STDOUT,call |