Skip to content

Instantly share code, notes, and snippets.

@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active May 14, 2024 18:19
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/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:
@BIGBALLON
BIGBALLON / extract_ILSVRC.sh
Created May 13, 2018 20:09
script for ImageNet data extract.
#!/bin/bash
#
# script to extract ImageNet dataset
# ILSVRC2012_img_train.tar (about 138 GB)
# ILSVRC2012_img_val.tar (about 6.3 GB)
# make sure ILSVRC2012_img_train.tar & ILSVRC2012_img_val.tar in your current directory
#
# https://github.com/facebook/fb.resnet.torch/blob/master/INSTALL.md
#
# train/
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@gdamjan
gdamjan / README.md
Last active May 3, 2024 07:59
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

@Apfelin
Apfelin / STTBot.py
Last active April 27, 2024 11:31
Discord speech-to-text bot, made with discord.py by Rapptz and voice additions by imayhaveborkedit. Uses wit.ai for speech recognition
import discord
import asyncio
import speech_recognition as sr
from threading import Thread
# bot token and wit.ai api key
TOKEN = ""
WIT_AI_KEY = ""
# we need a sink for the listen function, so we just define our own
@jpanganiban
jpanganiban / gist:3844261
Created October 6, 2012 07:05
Pygame + OpenCV Real-time Face Detection
#!/usr/bin/env python
from pygame import camera
import pygame
import time
import cv
import os
# Recognition
@mbostock
mbostock / .block
Last active March 7, 2024 22:20
Collapsible Force Layout
license: gpl-3.0
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mooware
mooware / colorstreamhandler.py
Last active July 20, 2023 16:16
Colored log output for Python logging framework. Works on Windows, Linux, and probably Mac as well.
# colored stream handler for python logging framework (use the ColorStreamHandler class).
#
# based on:
# http://stackoverflow.com/questions/384076/how-can-i-color-python-logging-output/1336640#1336640
# how to use:
# i used a dict-based logging configuration, not sure what else would work.
#
# import logging, logging.config, colorstreamhandler
#
@vsubhashini
vsubhashini / readme.md
Last active January 24, 2023 21:43
Sequence to Sequence - Video to Text (S2VT)