M = [[1,2,3], [4,5,6], [7,8,9]]
# diagonal
[M[i][i] for i in len(0, len(M))]
# reverse diagonal
[M[i][-(i+1)] for i len(0, len(M)]
from string import maketrans
inTable = "abcde"
### Keybase proof | |
I hereby claim: | |
* I am shervinafshar on github. | |
* I am shervinafshar (https://keybase.io/shervinafshar) on keybase. | |
* I have a public key whose fingerprint is 1501 573E 214A 0691 AB4F F613 801A AA7B 118A FC2E | |
To claim this, I am signing this object: |
C:\Perl-510\ppm.bat list | perl -wnE "system('C:\Perl-516\bin\ppm.bat install ' . $_ . ' --force') for /^\| (.+?)\|/g" |
import pytz, datetime, calendar | |
#import dateutil | |
d1 = datetime.datetime(2013, 4, 20, 7, 50, tzinfo=pytz.timezone('US/Pacific')) | |
d2 = datetime.datetime(2013, 4, 20, 9, 40, tzinfo=pytz.timezone('US/Pacific')) | |
d1Utc = d1.astimezone(pytz.timezone('UTC')) | |
d1UtcTs = calendar.timegm(d1.utctimetuple()) |
ls -Z | |
sudo chcon -Rv --type=httpd_sys_content_t folder/ |
wget -e robots=off --wait 1 http://www.foo.bar |
# Source machine | |
defaults export com.vladalexa.MagicPrefs magicpref.plist | |
# Target machine | |
defaults import com.vladalexa.MagicPrefs magicpref.plist |
/* | |
Minimal tweaks to WeLL Primary Engaged style sheet[1] aiming for a dark mode. | |
I like Meta Pro and Meta Serif from FF Meta family[2]; former for the editor | |
and UI elements and the latter for posts body text. You should probably pick | |
your own serif and sans-serif. Uses `box-sizing` which is unsupported in IE6 | |
and IE7. Sample screenshot are here[3]. | |
[1]: https://user.well.com/annotated/main.html | |
[2]: https://www.fontshop.com/families/ff-meta | |
[3]: https://imgur.com/a/Wh7InRx |