Skip to content

Instantly share code, notes, and snippets.

View hernantz's full-sized avatar
🏠
Working from home

hernantz

🏠
Working from home
View GitHub Profile
@e7d
e7d / remove-obsolete-gpg-key-from-dnf.md
Last active May 20, 2024 16:43
Remove obsolete GPG key from DNF (Fedora)
@karlafej
karlafej / str-repr.ipynb
Last active May 2, 2019 10:25
__str__ vs. __repr__
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phuysmans
phuysmans / gist:4f67a7fa1b0c6809a86f014694ac6c3a
Created January 8, 2018 09:29
docker compose health check example
version: '2.1'
services:
php:
tty: true
build:
context: .
dockerfile: tests/Docker/Dockerfile-PHP
args:
version: cli
volumes:
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active May 22, 2024 14:36
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paulirish
paulirish / what-forces-layout.md
Last active May 23, 2024 14:12
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@robintema
robintema / GeneralSerializer.py
Last active December 7, 2020 14:10
General Django Rest Framework model serializer
import logging
from rest_framework import serializers
class GeneralModelSerializer(serializers.ModelSerializer):
""" General model serializer that will serialize a model object. It will return all the model fields.
"""
class Meta:
model = None
@NotSqrt
NotSqrt / settings_test_snippet.py
Last active May 1, 2022 01:34 — forked from nealtodd/settings_test_snippet.py
Another shot at this problem ..
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
return "notmigrations"
MIGRATION_MODULES = DisableMigrations()
@T31337
T31337 / CapCam.py
Last active January 11, 2017 12:49
ScreenRecorder&Microphone Audio Recorder Using FFMPEG & Python
#!/usr/bin/env python3
'''
This Script Is Mainly From A Youtube User,
I Only Modified It Slightly To Make It Python3 Compatable,
And Added Custom Microphone Recording Support
Original Source Code: http://pastebin.com/BY1t5AcC
Thanks To Youtube User NoBeansJose
License:
@staltz
staltz / introrx.md
Last active May 24, 2024 07:56
The introduction to Reactive Programming you've been missing
@brianjmiller
brianjmiller / Gruntfile.js
Last active August 29, 2015 14:01
Backbone-stack updates
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
/**
* Watching
* ========