Skip to content

Instantly share code, notes, and snippets.


Valentino Constantinou vc1492a

View GitHub Profile
fire1ce / Raspberry Pi 3 TOR Access Point
Last active Oct 5, 2020
Raspberry Pi 3 TOR Access Point Router
View Raspberry Pi 3 TOR Access Point


Follow the progress of this project here Raspberry Pi 3 TOR Access Point Router Project

Network: Router RJ45 <--> Ethernet Port on Raspberry <--> TOR <--> Raspberry WIFI AC <--> WIFI CLIENT

# -- Download Rasbian Strech Lite from:
import numpy as np
from numpy.linalg import norm, solve
from scipy.spatial.distance import cdist
from sklearn.neighbors import kneighbors_graph
def phi(l, mu):
return (mu * (np.sqrt(l) - 1)**2)
joyrexus /
Last active Nov 25, 2020
collapsible markdown

collapsible markdown?


yes, even hidden code blocks!

print("hello world!")
gagarine /
Last active Nov 12, 2020
Howto Install clamav on OSX with brew

Howto Install clamav on OSX with brew

$ brew install clamav
$ cd /usr/local/etc/clamav
$ cp freshclam.conf.sample freshclam.conf

Open freshclam.conf and comment the "Example" (in new version it may be "FooClam") line:

dannguyen /
Last active Nov 4, 2020
Using Python 3.x and Google Cloud Vision API to OCR scanned documents to extract structured data

Using Python 3 + Google Cloud Vision API's OCR to extract text from photos and scanned documents

Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.

The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.

On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:

####### 1. A low-resolution photo of road signs

arfon / generate
Last active Feb 20, 2020
Let's try and generate some codemeta files.
View generate
# For an OO language, this is distinctly procedural. Should probably fix that.
require 'json'
details ={})
capture_params = [
{ :name => "title", :message => "Enter project name." },
{ :name => "url", :message => "Enter the URL of the project repository." },
zhurui1008 /
Created Dec 9, 2015
Get ClamAV running on Mac OS X (using Homebrew)

Get ClamAV running on Mac OS X (using Homebrew)

The easiest way to get the ClamAV package is using Homebrew

$ brew install clamav

Before trying to start the clamd process, you'll need a copy of the ClamAV databases.

Create a freshclam.conf file and configure as so

rasmusab / probability_of_pregnancy.R
Created Nov 5, 2015
A script that implements a Bayesian model calculating the probability that a couple is fertile and is going to be pregnant.
View probability_of_pregnancy.R
# A Bayesian model that calculates a probability that a couple is fertile
# and pregnant. Please use this for fun only, not for any serious purpose
# like *actually* trying to figure out whether you are pregnant.
# Enter your own period onsets here:
period_onset <- as.Date(c("2014-07-02", "2014-08-02", "2014-08-29", "2014-09-25",
"2014-10-24", "2014-11-20", "2014-12-22", "2015-01-19"))
# If you have no dates you can just set days_between_periods to c() instead like:
# days_between_periods <- c()
days_between_periods <- as.numeric(diff(period_onset))
kdzwinel / main.js
Last active Nov 23, 2020
List all undefined CSS classes
View main.js
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets.
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there).
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: .
Known limitations:
- it won't be able to take into account some external stylesheets (if CORS isn't set up)
- it will produce false negatives for classes that are mentioned in the comments.
Falconerd / gulpfile.js
Last active Apr 10, 2019
Gulp + Watchify + Babelify + BrowserSync
View gulpfile.js
* This gulpfile will copy static libraries and a index.html file as well as
* merge, babelify and uglify the rest of the javascript project.
* - Separate media, libs and src with different watchers.
* - Media and libs should only be copied to dist if they are different sizes.
* The expected project is to be laid out as such:
You can’t perform that action at this time.