I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
This file contains 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
import sys | |
print('loading file') | |
pgnfile = open(sys.argv[1], 'rb') | |
glob = pgnfile.read() | |
print('done') | |
print('convertingbytes') | |
pgn = '' | |
for b in glob: | |
c = chr(b) | |
pgn += c |
This file contains 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
# pesh stuff | |
alias a="open -a Atom" | |
alias vhost="open -a Atom /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf /etc/hosts" | |
alias zsh="open -a Atom ~/.zshrc" | |
alias log="open -a Atom ~/Sites/log" | |
alias c="bundle exec compass watch" | |
# alias clone="echo 'git clone [email protected]:front/'| pbcopy" | |
## NF settings | |
alias nfa='cd ~/Sites/front/newsfront-drupal/sites/all && open ~/Sites/front/newsfront-drupal/sites/all' |
This file contains 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
<?php | |
$certificateCAcer = '/certificate.cer'; | |
$certificateCAcerContent = file_get_contents($certificateCAcer); | |
/* Convert .cer to .pem, cURL uses .pem */ | |
$certificateCApemContent = '-----BEGIN CERTIFICATE-----'.PHP_EOL | |
.chunk_split(base64_encode($certificateCAcerContent), 64, PHP_EOL) | |
.'-----END CERTIFICATE-----'.PHP_EOL; |