javascript:script=document.createElement("script");script.src="https://cdn.rawgit.com/wlib/0d4c68436f7930a8804a109afe484317/raw/quizletTestAnswers.js";document.body.appendChild(script);//
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Watch how E changes as n increases | |
# For good display, I set the cursor off | |
# To make your cursor appear again, try ``printf "\033[?25h" | |
def e(rounds) | |
print "\033[?25l" | |
for n in 1..rounds do | |
e = (1 + 1.0 / n) ** n | |
if n % 10 == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Without an argument, just parse the current page's URL, if an argument is supplied, parse that | |
function parseQuery(query = window.location.search.substring(1)) { | |
// Decode the URL-safe query string into a regular string e.g.("%20" => " ") | |
const decodedQuery = decodeURIComponent(query); | |
// Split that string at every "&" to get all the key=value pairs | |
const allpairs = decodedQuery.split("&"); | |
// Declare an object to hold our output | |
const out = {}; | |
// This regex matches what seems to look like valid JSON | |
const regex = /^[\[|\{](\s|.*|\w)*[\]|\}]$/g; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parse(query) { | |
const allpairs = query.split("&"); | |
const out = {}; | |
for (let i = 0; i < allpairs.length; i++) { | |
let pair = allpairs[i].split("="); | |
let key = pair[0]; | |
let val = pair[1]; | |
out[key] = val; | |
} | |
return out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to your ~/.bashrc file for quick installation of .deb files, you can then update programs with `debinst URL` | |
inst() { | |
sudo apt install $1 --assume-yes | |
} | |
debinst() { | |
wget $1 -O /tmp/install.deb | |
sudo dpkg -i /tmp/install.deb | |
inst -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get(path="/", domain="https://api.duckduckgo.com") | |
require 'open-uri' | |
endpoint = "#{domain}/#{path}" | |
body = open(endpoint).read | |
return body | |
end | |
def get_favicon(page) | |
favicon = get("/i/#{page}.ico") | |
require 'digest' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Summarize a long file | |
# Uses the wonderful freesummarizer.com API | |
# Implemented by Daniel Ethridge | |
require 'uri' | |
require 'net/http' | |
# Get the text to summarize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){const editor%3Ddocument.querySelector("div.commit-create > div.CodeMirror");editor.setAttribute("style"%2C"height%3A50%25");})();// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){const code%3Ddocument.querySelector("div.commit-create > textarea").value;const tab%3Dwindow.open();tab.document.write(code)})();// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You must run this on the website because of the | |
// authentication method and CORS | |
// We get the definitions here | |
function callback(defs) { | |
window.quizlet = ""; | |
for (let word in defs) { | |
quizlet += (word + "\t" + defs[word].join(", ") + "\n"); | |
} | |
console.log(quizlet); |
OlderNewer