Skip to content

Instantly share code, notes, and snippets.

View haylinmoore's full-sized avatar
🦖
dns

haylin haylinmoore

🦖
dns
View GitHub Profile
@haylinmoore
haylinmoore / smloadrM3U8ToMPDM3U
Created February 7, 2020 20:53
A simple utility to convert the m3u8 file generated by smloadr to an m3u file for MPD
cat convertM3u8.sh
awk '/^#/ {sub(/#.*/,"");getline;}1' "$1" > tmpfile
sed -i 's/..\///' tmpfile
mv tmpfile ~/.config/mpd/playlists/$(echo "$1" | sed 's/ //g' | sed 's/m3u8/m3u/')
rm "$1"
function mult(a, b){
if (a == 0 && b == 0){
return 0
}
if (a == 0 && b == 1){
return 0
}
@haylinmoore
haylinmoore / oAuthGoogle.js
Last active May 18, 2019 08:31
Simple NodeJS Module to get the email of oAuth
var { google } = require("googleapis");
var googleConfig = {
clientId: "clientId", // e.g. asdfghjkljhgfdsghjk.apps.googleusercontent.com
clientSecret: "clientSecret", // e.g. _ASDFA%DFASDFASDFASD#FAD-
redirect: "redirectURL" // this must match your google api settings
};
var scopes = ["https://www.googleapis.com/auth/plus.me", "https://www.googleapis.com/auth/userinfo.email"];
var oauth2Client = new google.auth.OAuth2(googleConfig.clientId, googleConfig.clientSecret, googleConfig.redirect);
javascript:document.body.innerHTML = `<style>* { margin: 0; padding: 0; }body, html { width:100% ;height:100% ;overflow:hidden ;margin:none;}iframe { width:100% ; height:100% ;border:none ;magrin:none;}</style><iframe src="${prompt("name")}" height="100%"></iframe>`;
javascript:(function(){function l(u,i){ var d=document;if(!d.getElementById(i)){var s=d.createElement('script');s.src=u;s.id=i;d.body.appendChild(s);}}l('https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js','jquery')})();