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
FROM python:3.6.8-alpine | |
LABEL image for a very simple flask application | |
WORKDIR /docker-flask | |
COPY . . | |
RUN ["pip3", "install", "pipenv"] |
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 re | |
pattern = r'[A|B]+$' | |
m = re.compile(pattern) | |
m = m.match('EAB') | |
print(m) |
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
<html> | |
<head> | |
<style> | |
main { | |
height: 4000px; | |
position: relative; | |
background: cornflowerblue; | |
} | |
h1 { |
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
class FooBase { | |
public x: number; | |
private y: number; | |
protected z: number; | |
} | |
// EFFECT ON INSTANCES | |
var foo = new FooBase(); | |
foo.x; // okay | |
foo.y; // ERROR : private |
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
pg_dump -U bolaji -h localhost -d lendme > dump.sql |
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
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
Database files have to be updated before starting the server, here are the steps that had to be followed: | |
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
brew unlink postgresql | |
brew install postgresql@9.6 | |
brew unlink postgresql@9.6 | |
brew link postgresql |
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
# Kill rails server and guard | |
bin/spring stop | |
brew services stop mysql | |
brew uninstall mysql | |
brew install mysql@5.5 | |
brew link mysql@5.5 --force | |
brew services start mysql@5.5 | |
rbenv uninstall 2.3.3 | |
rbenv install 2.3.3 | |
gem install bundle |
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 asyncio | |
# Borrowed from http://curio.readthedocs.org/en/latest/tutorial.html. | |
@asyncio.coroutine | |
def countdown(number, n): | |
while n > 0: | |
print('T-minus', n, '({})'.format(number)) | |
yield from asyncio.sleep(1) | |
n -= 1 |
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
const startForLoop = async () => { | |
const loans = [ | |
'loanOne', 'loanTwo', 'loanThree', 'loanFour', 'loanFive', 'loanSix', 'loanSeven', 'loanEight' | |
]; | |
let transactionCount = 0; | |
const transactionLimit = 3; | |
const waitFor = (ms) => new Promise(r => setTimeout(r, ms)); | |
for (let index = 0; (index < loans.length && transactionCount <= transactionLimit); index += 1) { |
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
========================================== | |
BASH SCRIPTING ========================================== | |
========================================== TEST COMMAND | |
========================================== | |
Invoke: bash [options] file | |
Shebang: #!/usr/bin/env bash Test: test expression | |
In script: [ expression ] | |
========================================== Alternate: [[ espression ]] | |
LOOP Does not split string words | |
========================================== Does not expand pathglobs* |