Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
### JHW 2018 | |
import numpy as np | |
import umap | |
# This code from the excellent module at: | |
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module | |
import random |
0o | |
0s | |
3a | |
3b | |
3d | |
6b | |
6o | |
a | |
a1 | |
a2 |
import android.widget.*; | |
import android.util.*; | |
import android.content.*; | |
import android.graphics.*; | |
/** | |
* the simple implementation of an EditText where each line is numbered on the left | |
*/ | |
public class LineNumberedEditText extends EditText { |
/** | |
* Calculate Shannon's entropy for a string | |
*/ | |
module.exports = (str) => { | |
const set = {}; | |
str.split('').forEach( | |
c => (set[c] ? set[c]++ : (set[c] = 1)) | |
); |
package com.nuchwezi.nulabs; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.View; | |
import com.nuchwezi.xlitedatabase.DBAdapter; // <-- get the DAL |
server { | |
server_name $domain_name; | |
root /var/www; | |
index index.html index.php; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
# Cache static files for as long as possible | |
location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ { | |
try_files $uri =404; |
#!/bin/bash | |
# Based on http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html | |
# Requires ffmpeg | |
filename="${1%.*}" | |
palette="/tmp/palette.png" | |
filters="scale=320:-1:flags=lanczos" | |
ffmpeg -v warning -i "$1" -vf "$filters,palettegen" -y $palette | |
ffmpeg -v warning -i "$1" -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y "$filename.gif" |
def verify_sign(public_key_loc, signature, data): | |
''' | |
Verifies with a public key from whom the data came that it was indeed | |
signed by their private key | |
param: public_key_loc Path to public key | |
param: signature String signature to be verified | |
return: Boolean. True if the signature is valid; False otherwise. | |
''' | |
from Crypto.PublicKey import RSA | |
from Crypto.Signature import PKCS1_v1_5 |