Skip to content

Instantly share code, notes, and snippets.

View JupyterJones's full-sized avatar

Jack Northrup JupyterJones

View GitHub Profile
@JupyterJones
JupyterJones / Combos.py
Created August 8, 2018 23:44
Get all possible combinations and permutations of numbers or words
#!/user/local/bin/python
# Enter a number or a phrase
from itertools import permutations
Xset = set()
SEARCH = raw_input("Search Phrase: ")
SEARCH = SEARCH.split(" ")
searchs = list(SEARCH)
print searchs
print "------------------------------------"
perm = permutations(searchs)
@JupyterJones
JupyterJones / summerise.py
Created August 10, 2018 02:38
Article summerizer
import warnings
warnings.filterwarnings('ignore', message='numpy.dtype size changed')
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk.stem.snowball import SnowballStemmer
import nltk
text = """
as machines grow with artifificial intelligence abilities, and the fact that there \
@JupyterJones
JupyterJones / EDITOR.py
Created August 30, 2018 01:36
ChatterBot Sqlite3 Editor - This will edit the db.sqlite3 file used by chatterbot
# EDITOR.py
print ("""
for usage:
import EDITOR
EDITOR.Help()
""")
"""
EDITOR.View()
An input window will open.
This prints 100 lines, you provide the starting point
@JupyterJones
JupyterJones / snippets.json
Last active September 19, 2018 04:46
Create a snippet - jupyter notebook snippet extensions
{"snippets":[
{ "name" : "Add Snippet", "code" :[
"!cp /home/jack/.local/share/jupyter/nbextensions/snippets/snippets.json snippets-temp.json",
"name = \" <place name here>\" ",
"codes =\"\"\" ",
"<place code here> ",
"\"\"\" ",
"count = 0 ",
"for line in codes.split('\\n'): ",
" if len(line) > 0: ",
@JupyterJones
JupyterJones / viewpage.sh
Created October 4, 2018 02:18
bash script view and save a webpage as -- currenttime.html -
#!/bin/bash
page="$(wget -O - $1)"
today=`date +%Y-%m-%d.%H:%M:%S`
new=$today".html"
echo "$page" >>$new
echo "$page"
@JupyterJones
JupyterJones / GETip.sh
Created October 4, 2018 04:12
Get the ip address of a running container
#!/bin/bash
# USAGE: GETip -container- Example:
# GETip 9837705e48ae
# will return 172.17.0.2
docker inspect $1 | jq -r .[0].NetworkSettings.IPAddress
@JupyterJones
JupyterJones / answer.sh
Created October 23, 2018 00:06
A script created for viewing text created with Char-rnn
#!/bin/bash
# A script created for viewing text created with Char-rnn
# https://github.com/karpathy/char-rnn
# this script turns the last file in dirctory "cv" into a variable fn
fn=$(ls -rt1 cv | tail -1)
# Below this runs the command:
# th sample.lua on the last file created in the directory 'cv'
# and primes it with the text entered after answer :
# The -gpuid -1 means no GPU is used just a CPU
# Actual use Example:
import numpy as np
# R matrix
R = np.matrix([ [-1,-1,-1,-1,0,-1],
[-1,-1,-1,0,-1,100],
[-1,-1,-1,0,-1,-1],
[-1,0,0,-1,0,-1],
[-1,0,0,-1,-1,100],
[-1,0,-1,-1,0,100] ])
@JupyterJones
JupyterJones / VIDEOinfo.py
Last active December 20, 2018 01:42
Retrieve and print video info using skvideo . SEE Comment: This code may be indexed to parse a video file for specific information.
from skvideo.io import *
import json
INFO = ffprobe("VID/videos/out.mp4")
print(json.dumps(INFO, indent=4))
"""
results in:
{
"video": {
"@index": "0",
"@codec_name": "h264",
@JupyterJones
JupyterJones / FFMPEG-Tutorial-YouTube-Video-Toolkit-Jupyter-Notebook.ipynb
Created March 13, 2019 12:54
FFMPEG-Tutorial-YouTube-Video-Toolkit-Jupyter-Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.