Skip to content

Instantly share code, notes, and snippets.

@fremeva
fremeva / gist:b0ef3d9e8f9ac5c974d938978dce7e61
Created April 3, 2023 16:33 — forked from AkiraKito/gist:4064958
Make the query only for the hours and minutes (datetime.time object) using SQLAlchemy
# -*- coding: utf-8 -*-
from sqlalchemy import Column, Time, Integer, Boolean, create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
# SQL statements and expressions API
# cf. http://docs.sqlalchemy.org/en/rel_0_7/core/expression_api.html
from sqlalchemy import and_, extract
@fremeva
fremeva / conventional-commits.md
Created March 6, 2023 22:16 — forked from Zekfad/conventional-commits.md
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@fremeva
fremeva / Python ignore pylint flake8 errors.md
Created October 31, 2022 14:19 — forked from Integralist/Python ignore pylint flake8 errors.md
[Python ignore pylint and flake8 linter errors] #tags: python, linter, ignore, pylint, flake8

Disable all linting across the entire file:

# pylint: disable-all (older)
# pylint: skip-file   (newer)
# flake8: noqa

Disable specific linting errors across the entire file:

@fremeva
fremeva / pytz-time-zones.py
Created June 16, 2022 04:22 — forked from heyalexej/pytz-time-zones.py
list of pytz time zones
>>> import pytz
>>>
>>> for tz in pytz.all_timezones:
... print tz
...
...
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
@fremeva
fremeva / testing_in_node.md
Created December 15, 2021 21:45 — forked from ivankisyov/testing_in_node.md
[Node] Testing

Testing with Jest

npm i --save-dev jest

package.json

{

Writing Tests with Jest on Node.js

Installation

npm i --save-dev jest

Configuration

@fremeva
fremeva / FileField_manual_initialisation.py
Created February 14, 2021 03:20 — forked from avoiney/FileField_manual_initialisation.py
Manually associate an existing file to a model FileField
# Assuming you have a Article Model like this
# class Article(models.Model):
# ... Some field
# media = models.FileField(upload_to="path_to_inner_media_folder", blank=True)
from django.core.files.base import ContentFile
import os
# Create an article with the associated model
new_article = Article()
@fremeva
fremeva / Sintaxis_interna_De_Un_README.md
Created January 9, 2021 06:45 — forked from NekoShooter/Sintaxis_interna_De_Un_README.md
Una pequeña introducción a la sintaxis de MarkDown

Sintaxis interna de un README.md

Titulos

La sintaxis para los titulos se hace de la siguiente manera

#Titulo <h1>
##Titulo <h2>
###Titulo <h3>
####Titulo 
@fremeva
fremeva / Sintaxis_interna_De_Un_README.md
Created January 9, 2021 06:45 — forked from NekoShooter/Sintaxis_interna_De_Un_README.md
Una pequeña introducción a la sintaxis de MarkDown

Sintaxis interna de un README.md

Titulos

La sintaxis para los titulos se hace de la siguiente manera

#Titulo <h1>
##Titulo <h2>
###Titulo <h3>
####Titulo