Skip to content

Instantly share code, notes, and snippets.

View piratus's full-sized avatar
💭
🏴‍☠️

Andrew Popovych piratus

💭
🏴‍☠️
View GitHub Profile
@piratus
piratus / ToggleDarkMode.js
Created October 24, 2020 15:04
Toggle MacOS Dark/Light mode
#!/usr/bin/env osascript -l JavaScript
function run(input, parameters) {
const appSE = Application("System Events");
appSE.includeStandardAdditions = true;
if (appSE.appearancePreferences.darkMode()) {
setLightMode(appSE)
} else {
setDarkMode(appSE)
@piratus
piratus / clock.html
Created December 18, 2021 10:35
Clock Widget
<!--Dayspedia.com widget--><div class="DPDC" cityid="1133" lang="en" id="dayspedia_widget_3b08714ada30771" host="https://dayspedia.com" ampm="false" nightsign="false" sun="true" style="background-image: url(&quot;https://cdn.dayspedia.com/img/widgets/bg-4.png&quot;); border-color: rgb(255, 255, 255); width: 100%; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-width: 0px; padding: 16px 16px 24px;">
<style media="screen" id="dayspedia_widget_3b08714ada30771_style">
/*COMMON*/
.DPDC{display:table;position:relative;box-sizing:border-box;font-size:100.01%;font-style:normal;font-family:Arial;background-position:50% 50%;background-repeat:no-repeat;background-size:cover;overflow:hidden;user-select:none}
.DPDCh,.DPDCd{width:fit-content;line-height:1.4}
.DPDCh{margin-bottom:1em}
.DPDCd{margin-top:.24em}
.DPDCt{line-height:1}
.DPDCth,.DPDCtm,.DPDCts{display:inline-block;vertical-align:text-top;white-space:nowrap}