Skip to content

Instantly share code, notes, and snippets.

View MrMe42's full-sized avatar
:octocat:
Moved on to IsaccBarker

MrMe42 MrMe42

:octocat:
Moved on to IsaccBarker
  • The inky void
View GitHub Profile
foobar
@MrMe42
MrMe42 / gist:5d6a84813023baea6e38c048e682174c
Created September 17, 2018 02:11
Go back n directories JAVA
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);
}
/*
"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",
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 March 28, 2018 00:05
a simple web-searching python script
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)