Skip to content

Instantly share code, notes, and snippets.

@tonmoay
tonmoay / cvimg.py
Created December 20, 2016 05:18
Template matching using OpenCV python. This code gets a real time frame from webcam & matches with faces in 'images' folder. After the lookup, it rectangles the webcam face & says with which face the webcam face matches
import cv2
from matplotlib import pyplot as plt
import numpy as np
cap = cv2.VideoCapture(0) #Webcam Capture
while(True):
ret, frame = cap.read()
package com.webs.itmexicali.colorized;
import java.io.DataOutputStream;
import java.io.IOException;
import com.webs.itmexicali.colorized.R;
import com.webs.itmexicali.colorized.util.Const;
import android.app.Activity;
import android.app.Service;
@crittermike
crittermike / wget.sh
Last active March 28, 2025 18:44
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@pigeonflight
pigeonflight / cleanup-querystrings.py
Created October 22, 2017 10:39
remove query strings on static resources downloaded with wget
"""
Often after performing a wget -p -k http://example.com
The resulting files will include static resources with query strings appended.
For example:
wp-content/themes/salient/css/fonts/fontawesome-webfont.woff?v=4.2
etc..
This script strips away the query strings so that you can serve the site statically.
This is the first step in porting a theme from another CMS to a Diazo based Plone theme
"""
import os
@EDDYMENS
EDDYMENS / Surreal.php
Last active March 17, 2024 16:43
Surreal DB PHP SDK
<?php
/**
* Surreal fluent query
*
* @author EDDYMENS
* @license MIT (or other licence)
*/
class Surreal
{