Skip to content

Instantly share code, notes, and snippets.

View gh640's full-sized avatar

Goto Hayato gh640

View GitHub Profile
yyx990803 /
Last active March 5, 2024 01:24
npm list only top level modules.
alias ng="npm list -g --depth=0 2>/dev/null"
alias nl="npm list --depth=0 2>/dev/null"
rxaviers / gist:7360908
Last active July 13, 2024 19:50
Complete list of github markdown emoji markup


:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
douglasmiranda /
Last active April 25, 2024 09:10
Fix: Django Debug Toolbar not showing when using with Docker.
# YOU MAY WANT TO CHECK THIS OUT:{{cookiecutter.django_project_name}}/{{cookiecutter.django_project_name}}/config/
# If you don't do this you will have to add the host IP in INTERNAL_IPS = ('',)
# And it will change, then you will have to change INTERNAL_IPS again.
def show_toolbar(request):
if request.is_ajax():
return False
return True
colorfield / debug.php
Created February 26, 2016 16:12
Override php.ini for debug on dev environment
// place this in a global script like settings.php in Drupal
ini_set("display_errors", 1);
ini_set("track_errors", 1);
ini_set("html_errors", 1);
chranderson / nvmCommands.js
Last active July 11, 2024 23:08
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
BretFisher /
Last active July 9, 2024 11:29
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info:

mdonkers /
Last active June 25, 2024 18:48
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
./ [<port>]
from http.server import BaseHTTPRequestHandler, HTTPServer
cobusc /
Last active August 31, 2021 17:32
Protected Media in Django

Protected Media in Django


Django manages media based on the following definitions:

BASE_DIR = /var/praekelt/telkom-spliceworks/
MEDIA_ROOT = "%s/media/" % BASE_DIR
majackson /
Last active June 1, 2024 11:19
Django migrations without downtime

Django Migrations without Downtime

The following instructions describe a set of processes allowing you to run Django database migrations against a production database without having to bring the web service down.

Note that in the below instructions, migrations are all run manually at explicit points, and are not an automatic part of the deployment process.

Adding Fields or Tables

Adding a (nullable) field or a new table

  1. Make the model or column addition in your code.
gh640 / Dockerfile
Last active February 5, 2022 13:02
Sample: Convert `.mov` file to `.gif` animation
FROM ubuntu:latest
RUN apt-get update && \
apt-get install -y ffmpeg && \
rm -rf /var/lib/apt/lists/*