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
"""Example to cancel a set of asyncio coroutines (futures), | |
using one coroutine to signal the event loop to stop. | |
""" | |
import asyncio | |
import logging | |
from datetime import datetime | |
from concurrent.futures import CancelledError | |
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
#1) crie os alias para o subdir | |
Alias /crm/ /srv/www/portais/crm/public/ | |
Alias /crm /srv/www/portais/crm/public/ | |
#2) defina as permissões do diretório físico | |
<Directory "/srv/www/portais/crm/public/"> | |
AllowOverride All | |
Options Indexes FollowSymLinks MultiViews Includes ExecCGI | |
Require all granted | |
</Directory> |
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
/* | |
Cell compete: | |
Eight houses, represented as a cells, are arranged as a straight line. | |
Each days every cells competes with adjacent cells. An integer value 1 | |
represents an active cell and a value of 0 represent an inactive cell. | |
if the neigbour on both the sides of the cell are both active or inactive, | |
the cell become inactive in the next day, otherwise the become active. | |
The two cells on each or have a single adjacent cell, so asume that | |
the onoccupied space in the opposite side is an inactive cell. even after | |
updating the cell state, consider its previus state when updating the state |
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
noremap ,g :!go run ./%<cr> | |
noremap ,t :!make test<cr> | |
setlocal omnifunc=v:lua.vim.lsp.omnifunc | |
compiler go | |
nnoremap <buffer> <space> :silent make <bar> redraw!<CR> | |
" noremap ,G :w!\|!go run --gcflags "-m=2" ./%<cr> | |
" noremap <localleader>g :w!\|!go run ./%<cr> | |
" noremap ,g :w!\|!go build; ./main<cr> |
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
#!/bin/sh | |
print_usage() { | |
echo "usage: compress_video <input_file>" | |
echo "supported formats: mp4, webm, mkv, mov, avi, flv" | |
} | |
get_extension() { | |
f="${1##*/}" | |
case "$f" in |