Skip to content

Instantly share code, notes, and snippets.

:octocat:
Focusing

Milo Banks MrMe42

:octocat:
Focusing
  • SLC, Utah, USA, Earth, Orbiting sol, Milky Way, universe, existence
Block or report user

Report or block MrMe42

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:5d6a84813023baea6e38c048e682174c
private static void downDir(int levels) {
String oldPath = System.getProperty("user.dir");
String[] splitedPathArray = oldPath.split("/");
levels = splitedPathArray.length - levels;
List<String> splitedPathList = Arrays.asList(splitedPathArray);
splitedPathList = splitedPathList.subList(0, levels);
String newPath = String.join("/", splitedPathList);
System.setProperty("user.dir", newPath);
}
/*
View Major and Minor scales .json
"Scales": {
"Major": {
"C Major": "C • Dm • Em • F • G • Am • Bdim",
"D♭ Major": "Db • Ebm • Fm • Gb • Ab • Bbm • Cdim",
"D Major": "D • Em • F#m • G • A • Bm • C#dim",
"E♭ Major": "Eb • Fm • Gm • Ab • Bb • Cm • Ddim",
"E Major": "E • F#m • G#m • A • B • C#m • D#dim",
"F Major": "F • Gm • Am • Bb • C • Dm • Edim",
"F♯ Major": "F# • G#m • A#m • B • C# • D#m • E#dim",
"G Major": "G • Am • Bm • C • D • Em • F#dim",
View installing python 3.6.5
wget http://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz`
tar -xzvf Python-3.6.5.tgz
cd Python-3.6.5
./configure --prefix=$HOME/local/python
make
make install
export PATH=$HOME/local/python/bin:$PATH
@MrMe42
MrMe42 / websearch.py
Created Mar 28, 2018
a simple web-searching python script
View websearch.py
import re
import urllib.request as ur
print('What would you like to look up?')
text = input('::')
search_string = text.split(' ')
search_string = '+'.join(search_string)
# you can change www.bing.com to any search engine except google.
googlesearch = 'https://www.bing.com/search?q=' + search_string
source = ur.urlopen(googlesearch)
You can’t perform that action at this time.