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
ramfs: | |
rm -r tmp | |
mkdir tmp | |
sudo mount -t tmpfs -o size=512m tmpfs ./tmp | |
clean: | |
rm -r tmp/* | |
rm dist/build.js |
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
package main | |
// based on gist | |
// https://gist.github.com/ir4y/11146415 | |
// http://stackoverflow.com/questions/21417223/simple-ssh-port-forward-in-golang | |
// obro conexio ssh amb el server remot. | |
// tot el que envio al port local ho copio al port remote | |
// a traves de la conexio remota. Per tant he d'obrir un | |
// port a la maquina remota? |
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 . import templates | |
from guillotina.entrypoint import app as guillo | |
from starlette.applications import Starlette | |
from starlette.responses import PlainTextResponse | |
from starlette.responses import JSONResponse | |
from guillotina.component import get_utility | |
from guillotina.interfaces import IApplication | |
from guillotina.utils.content import get_database | |
from guillotina.utils.content import navigate_to | |
from guillotina import task_vars |
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 functools import partial | |
from imaplib import Int2AP | |
from starlette.responses import JSONResponse | |
from starlette.applications import Starlette | |
from starlette.routing import Route | |
import httpx | |
import json | |
import pydantic as pd | |
import random |
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.7.3 | |
# based on a git clone from https://github.com/CollectivaT-dev/catotron-cpu | |
# plus embedding voices. | |
# also fixed requirements.txt | |
# -matplotlib==2.1.0 | |
# +numba==0.48 | |
# +matplotlib==3.3.2 | |
# numpy==1.18.0 | |
# inflect==0.2.5 |
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 textwrap | |
sql = textwrap.dedent(""" | |
SELECT t1.field1, | |
t2.field2, | |
t3.field3 | |
FROM table1 t1 | |
INNER JOIN table2 t2 using(id_relation) | |
WHERE t1.pk = $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
ga () { | |
git add . | |
git commit -am "$*" | |
git push origin master | |
} | |
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 MyFunctionnalComponent: React.FC = props => { | |
useEffect(() => { | |
// Using an IIFE | |
(async function anyNameFunction() { | |
await loadContent(); | |
})(); | |
}, []); | |
return <div></div>; |
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
docker run --rm -e 'TESTING=jenkins' -e 'DATABASE=postgres' -v /var/run/docker.sock:/var/run/docker.sock checkout:PR-173.1 'py.test checkout/tests/ -x -s -v' | |
Traceback (most recent call last): | |
File "/usr/local/bin/py.test", line 10, in <module> | |
sys.exit(main()) | |
File "/usr/local/lib/python3.7/site-packages/_pytest/config/__init__.py", line 61, in main | |
config = _prepareconfig(args, plugins) | |
File "/usr/local/lib/python3.7/site-packages/_pytest/config/__init__.py", line 182, in _prepareconfig | |
config = get_config() | |
File "/usr/local/lib/python3.7/site-packages/_pytest/config/__init__.py", line 156, in get_config | |
pluginmanager.import_plugin(spec) |
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 Based changelist, composition | |
''' | |
class MisOfertas(ModelAdmin): | |
list_display = ( 'get_estado', 'nombre', 'origen_', 'destino_', 'owner_', | |
'caducidad', 'editar', 'borrar') | |
list_filter = ( 'status', CargadorFilter, OrigenFilter, DestinoFilter ) | |
search_fields = ( 'nombre', 'owner__business_name', 'owner__comercial_name', |
NewerOlder