This file contains hidden or 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 sh | |
| AVERAGE=$(ls /sys/class/power_supply | grep "BAT" | xargs -I % cat /sys/class/power_supply/%/capacity | awk '{ total += $1; count++ } END { printf "%.0f", total/count }') | |
| STATUSES=$(ls /sys/class/power_supply | grep "BAT" | xargs -I % cat /sys/class/power_supply/%/status | sed -e "s/,//;s/Discharging/🔋/;s/Not charging//;s/Charging/🔌/;s/Unknown//;s/Full//;s/ 0*/ /g;s/ :/ /g" | tr -d '\n') | |
| echo "$AVERAGE% $STATUSES" |
This file contains hidden or 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
| 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" |
This file contains hidden or 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 mult(a, b){ | |
| if (a == 0 && b == 0){ | |
| return 0 | |
| } | |
| if (a == 0 && b == 1){ | |
| return 0 | |
| } |
This file contains hidden or 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
| 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); |
This file contains hidden or 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: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>`; |
This file contains hidden or 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(){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')})(); |
NewerOlder