Skip to content

Instantly share code, notes, and snippets.

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

Andrew Popovych piratus

💭
🏴‍☠️
View GitHub Profile
@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}
@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 / race_results.tsv
Last active October 25, 2020 13:55
MotoGP results
year sequence rider country position points bike
1993 1 Schwantz, Kevin US 1 25 Suzuki
1993 1 Rainey, Wayne US 2 20 Yamaha
1993 1 Chandler, Doug US 3 16 Cagiva
1993 1 Beattie, Daryl AU 4 13 Honda
1993 1 Barros, Alex BR 5 11 Suzuki
1993 1 Criville, Alex ES 6 10 Honda
1993 1 Ito, Shinichi JP 7 9 Honda
1993 1 Cadalora, Luca IT 8 8 Yamaha
1993 1 Mladin, Matt AU 9 7 Cagiva
@piratus
piratus / !index.md
Last active May 29, 2019 13:36
GP Data
We can't make this file beautiful and searchable because it's too large.
name race win
Aalt Toersen 1967-3 0
Aalt Toersen 1967-4 0
Aalt Toersen 1968-4 0
Aalt Toersen 1969-1 1
Aalt Toersen 1969-2 1
Aalt Toersen 1969-3 1
Aalt Toersen 1969-5 0
Aalt Toersen 1969-6 0
Aalt Toersen 1969-7 0
id name shortName country
albi Albi Albi FR
americas Circuit of the Americas Texas US
anrstorp Anderstorp Anderstorp SE
catalunya Circuit de Barcelona-Catalunya Catalunya ES
belfast Belfast Belfast GB
berne Berne Berne CH
brno Automotodrom Brno Brno CZ
clermont-ferrand Clermont-Ferrand Clermont-Ferrand FR
daytona Daytona Daytona US
@piratus
piratus / pirata.cfg
Created February 5, 2016 16:32
My Quake 2 config file
//* 30.12.2005 *//
unbindall
//Settings
bind mwheelup ""
bind mwheeldown ""
clear
//* personal
set zoom_fov 65
@piratus
piratus / Piratus Dark.tmTheme
Created December 28, 2015 15:01
Dark theme for Sublime Text
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>settings</key>
<array>
<dict>
<key>settings</key>
<dict>
<key>background</key>
@piratus
piratus / Label.jsx
Last active August 29, 2015 14:25
Text truncating label
import React from 'react';
const STYLE = {
display: 'inline-block',
overflow: 'hidden',
whiteSpace: 'nowrap',
};
const MIN_TEXT_LENGHT = 6;
const MIN_LABEL_WIDTH = 40;