Skip to content

Instantly share code, notes, and snippets.

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

Muhammad Nur Wahid neoreids

🏠
Working from home
View GitHub Profile
@neoreids
neoreids / README.md
Created March 25, 2021 00:15 — forked from BoGnY/README.md
[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)

Requirements

  • Install GPG4Win: this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is a GUI that uses GTK+, GpgOL and GpgEX that are respectively an extension for MS Outlook and an extension for Windows Explorer shell
  • Install Git for Windows: so you can have a *nix based shell, this software is a bundle with latest version of Git which use MINGW environment, a Git bash shell, a Git GUI and an extension for Windows Explorer shell (Make sure your local version of Git is at least 2.0, otherwise Git don't have support for automatically sign your commits)
  • Verify
@neoreids
neoreids / README.md
Created March 24, 2021 14:07 — forked from paolocarrasco/README.md
How to understand the `gpg failed to sign the data` problem

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@neoreids
neoreids / django_undo_migration.md
Created February 26, 2021 05:16 — forked from repodevs/django_undo_migration.md
How to undo migration in Django

Let say you have migrations like this

project/apps/accounts/migrations
├── 0001_initial.py
├── 0002_historicalprofile_historicaluser.py
├── 0003_auto_20190807_1559.py
├── 0004_auto_20190811_1013.py
@neoreids
neoreids / .ideavimrc
Created December 28, 2020 04:16 — forked from dewaka/.ideavimrc
set ignorecase
set smartcase
set scrolloff=3 " 3 lines above/below cursor when scrolling
" Emulated Plugins
set surround
" Copy to system clipboard as well
set clipboard+=unnamed
@neoreids
neoreids / gist:9383531dfe6e7f0e05c7a06c09f94b48
Created October 23, 2020 17:14
Proxy_pass default config for enable https proxy
proxy_buffers 32 4m;
proxy_busy_buffers_size 25m;
proxy_buffer_size 512k;
proxy_ignore_headers "Cache-Control" "Expires";
proxy_max_temp_file_size 0;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 1024m;
client_body_buffer_size 4m;
@neoreids
neoreids / .gitlab-ci.yml
Created June 9, 2020 13:39 — forked from superjose/.gitlab-ci.yml
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.
@neoreids
neoreids / HowToFixPycURLErrorMacOS.md
Created May 27, 2020 02:34 — forked from webinista/HowToFixPycURLErrorMacOS.md
PycURL error: ConfigurationError: Curl is configured to use SSL, but we have not been able to determine which SSL backend it is using. Please see PycURL documentation for how to specify the SSL backend manually.

Partly pulled from the comments here: pycurl/pycurl#526

May also be a fix for this error:

ImportError: pycurl: libcurl link-time ssl backend (none/other) is different from compile-time ssl backend (openssl)

If you try to install PycURL and receive this error:

@neoreids
neoreids / pil_s3.py
Created May 11, 2020 22:57 — forked from ghandic/pil_s3.py
Load image from S3 directly into memory as PIL image and write to S3 directly from memory from PIL image
import boto3
from PIL import Image
from io import BytesIO
import os
class S3ImagesInvalidExtension(Exception):
pass
class S3ImagesUploadFailed(Exception):
pass
@neoreids
neoreids / gist:b54657028936e2774b03fc04e2241fcf
Created April 22, 2020 04:05 — forked from aaugustin/gist:2351479
Django: log all database queries in the console
import logging
logger = logging.getLogger('django.db.backends')
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler())
@neoreids
neoreids / validators.py
Created April 14, 2020 09:55 — forked from jrosebr1/validators.py
Validator for files, checking the size, extension and mimetype for Django.
# @brief
# Performs file upload validation for django. The original version implemented
# by dokterbob had some problems with determining the correct mimetype and
# determining the size of the file uploaded (at least within my Django application
# that is).
# @author dokterbob
# @author jrosebr1
import mimetypes