Skip to content

Instantly share code, notes, and snippets.

View year.php
<?php
$today = date('Ymd');
$this_year = date('Y');
if ($today <= $this_year . "0901") {
echo $this_year;
}
else {
echo $this_year + 1;
}
?>
View fightback.html
<noscript>
<!-- thedaywefightback banner -->
<a href="https://thedaywefightback.org">
<div style="background:black;height:100px;width:100%;bottom:0;position:fixed;text-align:center;">
<img height="110px" width="auto" src="./images/thedaywefightback.png" alt="" width="664" height="272">
</div>
</a>
<!-- /thedaywefightback -->
</noscript>
View keybase.md

Keybase proof

I hereby claim:

  • I am myano on github.
  • I am yano (https://keybase.io/yano) on keybase.
  • I have a public key whose fingerprint is 3C99 3EE0 5B52 C25F A0A3 C0FC 1A29 1C36 DD4C 89A9

To claim this, I am signing this object:

View webbrowser.py
#!/usr/bin/env python
import sys
from PyQt4 import QtCore, QtGui, QtWebKit
from ui_mainwindow import Ui_MainWindow
class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
# Maintain the list of browser windows so that they do not get garbage
# collected.
_window_list = []
View gist:2304ac943ecae5ff6203
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
My twitter handle is [@kd8rhr](https://twitter.com/kd8rhr)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAEBCgAGBQJTj5D5AAoJEKBpQL3CDq4d0W0P/jzH8cRszxpQiKQwMRtm3lfH
o3EZg58xyiApKE0XMPzLhwnU7iXo9FNeGIwnxJODRT+sfiUd3eF6tqPRzhwLQr+W
View keybase.md

Keybase proof

I hereby claim:

  • I am myano on github.
  • I am yano (https://keybase.io/yano) on keybase.
  • I have a public key whose fingerprint is 4515 CA81 98B9 AED8 F7BB DAC7 A069 40BD C20E AE1D

To claim this, I am signing this object:

View split_files.py
#!/usr/bin/env python
import os
def file_size_from_list(incoming_list):
## returns total size in bytes of all files in the incoming list
total = 0
View gist:a8256138de354d34f437
do you want to build a program?
it doesn't have to be a program
come on lets go and code
i never see you write code
it's like you hate code now
we use to pair program lots!
and now we're not
i wish you would write some code
View channel_overlap.py
#!/usr/bin/env python
'''
Copyright 2015 Michael Yanovich, yanovich.net
Licensed under the Eiffel Forum License 2.
'''
from sets import Set
def prepare_list(inc):
View python_term_colors.py
#!/usr/bin/env python
from colorama import init, Fore
init()
print(Fore.RED + 'some red text')
print('automatically back to default color again')