Skip to content

Instantly share code, notes, and snippets.

View vigo's full-sized avatar
🕶️
I may be slow to respond.

Uğur Özyılmazel vigo

🕶️
I may be slow to respond.
View GitHub Profile
@shymonk
shymonk / customize-save-in-django-admin-inline-form.org
Last active April 14, 2024 02:55
How to customize save in django admin inline form?

Customize Save In Django Admin Inline Form

Background

This is a common case in django ORM.

from django.db import models

class Author(models.Model):
@mariocj89
mariocj89 / python-logging.md
Last active April 13, 2024 13:15
Understanding logging in Python

Logging trees

Introduction

When applications are running in production, they become black boxes that need to be traced and monitored. One of the simplest, yet main, ways to do so is logging. Logging allows us - at the time we develop our software - to instruct the program to emit information while the system is running that will be useful for us and our sysadmins.

@millermedeiros
millermedeiros / osx_setup.md
Last active April 12, 2024 12:40
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

@jonlabelle
jonlabelle / npm_vs_yarn_command_translation_cheatsheet.md
Last active April 11, 2024 15:26
npm vs yarn command translation cheat sheet
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@acdha
acdha / simple_cors_server.py
Last active April 7, 2024 19:57
Python 3: serve the current directory as HTTP while setting CORS headers for XHR debugging
#!/usr/bin/env python3
# encoding: utf-8
"""Use instead of `python3 -m http.server` when you need CORS"""
from http.server import HTTPServer, SimpleHTTPRequestHandler
class CORSRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header('Access-Control-Allow-Origin', '*')
@ozdemirburak
ozdemirburak / cities_of_turkey.json
Last active April 7, 2024 09:39
List of cities in Turkey presented in JSON format with the information of name, latitude, longitude, population and region.
[
{
"id": 1,
"name": "Adana",
"latitude": "37.0000",
"longitude": "35.3213",
"population": 2183167,
"region": "Akdeniz"
},
{
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@btoone
btoone / curl.md
Last active April 2, 2024 20:18
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@shinzui
shinzui / tmux.conf
Created March 12, 2011 01:08 — forked from bryanl/tmux.conf
tmux.conf
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#