Skip to content

Instantly share code, notes, and snippets.

@ekinertac
ekinertac / field_blank_null.md
Last active April 15, 2024 08:38
Django null/blank field explanation
Fields null=True blank=True
CharField, TextField, SlugField, EmailField, CommaSeparatedIntegerField DON'T Django's convention is to store empty values as the empty string, and to always retrieve NULL or empty values as the empty string for consistency. OK Do this if you want the corresponding form widget to accept empty values. If you set this, empty values get stored as empty strings in the database.
BooleanField DON'T Use NullBooleanField instead. DON'T
IntegerField, FloatField, DecimalField OK If you wabt to be able to set the value to NULL in the database OK if you want the corresponding form widget to accept empty values. if so out will also want to set null=True
DateTimeField, DateField, TimeField OK if you want to be able to set the value to NULL in the database. OK If you want the corresponding form widget to accept empty values, or if you are using auto now or auto now add. If so, you will al
@yasirkula
yasirkula / BoxColliderWizard.cs
Last active April 15, 2024 08:37
Creating & editing BoxColliders intuitively in Unity
#if UNITY_EDITOR
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using UnityEngine.Rendering;
#endif
using UnityEngine;
public class BoxColliderWizard : MonoBehaviour
@2KAbhishek
2KAbhishek / Shell_Keybindings.md
Last active April 15, 2024 08:36
Keyboard shortcuts for bash/zsh

Shell Keybindings

Navigation πŸš€

Alt + f/b - Move cursor to previous/next word

Ctrl + a/e - Move cursor to beginning/end of command

Ctrl + xx - Toggle between the start of line and current cursor position

@joemcgill
joemcgill / README.md
Last active April 15, 2024 08:35
WPP Better Image Sizes is a proof of concept WordPress plugin that provides a better calculation for the default sizes attribute for images.

WPP Better Image Sizes

This is a WordPress Plugin that improves the default sizes attribute calculation for images.

Description

WPP Better Image Sizes is a WordPress plugin that provides a better calculation for the default sizes attribute for images. This plugin is designed to enhance the performance and responsiveness of your WordPress site.

Installation

@X-Raym
X-Raym / Highcharts Cheat Sheet.js
Created June 8, 2017 11:06 — forked from mulhoon/Highcharts Cheat Sheet
Highcharts Cheat Sheet
$('#container').highcharts({
chart: {
alignTicks: true, // When using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks.
animation: true, // Set the overall animation for all chart updating. Animation can be disabled throughout the chart by setting it to false here.
backgroundColor: '#FFF', // The background color or gradient for the outer chart area.
borderColor: '#4572A7', // The color of the outer chart border.
borderRadius: 5, // The corner radius of the outer chart border. In export, the radius defaults to 0. Defaults to 5.
borderWidth: 0, // The pixel width of the outer chart border.
className: null, // A CSS class name to apply to the charts container div, allowing unique CSS styling for each chart.
defaultSeriesType: 'line', // Alias of type.
@jtmcdole
jtmcdole / .promptrc
Last active April 15, 2024 08:38
My byobu prompt
#!/bin/bash
# modified from byobu's bashrc -- colorize the prompt
# Copyright (C) 2014 Dustin Kirkland
#
# Authors: Dustin Kirkland <kirkland@byobu.co>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 15, 2024 08:31
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@ihoneymon
ihoneymon / how-to-write-by-markdown.md
Last active April 15, 2024 08:30
λ§ˆν¬λ‹€μš΄(Markdown) μ‚¬μš©λ²•

[곡톡] λ§ˆν¬λ‹€μš΄ markdown μž‘μ„±λ²•

μ˜μ–΄μ§€λ§Œ, 쑰금 더 μƒμ„Έν•˜κ²Œ λ§ˆν¬λ‹€μš΄ μ‚¬μš©λ²•μ„ μ•ˆλ‚΄ν•˜κ³  μžˆλŠ”
"Markdown Guide (https://www.markdownguide.org/)" λ₯Ό λ³΄μ‹œλŠ” 것을 μΆ”μ²œν•©λ‹ˆλ‹€. ^^

μ•„, 그리고 λ§ˆν¬λ‹€μš΄λ§ŒμœΌλ‘œ ν‘œν˜„μ΄ λΆ€μ‘±ν•˜λ‹€κ³  λŠλΌμ‹ λ‹€λ©΄, HTML νƒœκ·Έλ₯Ό ν™œμš©ν•˜μ‹œλŠ” 것도 μ’‹μŠ΅λ‹ˆλ‹€.

1. λ§ˆν¬λ‹€μš΄μ— κ΄€ν•˜μ—¬

@Zekfad
Zekfad / conventional-commits.md
Last active April 15, 2024 08:29
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
@othyn
othyn / factorio_headless_guide.md
Last active April 15, 2024 08:27
How to setup a Factorio Headless Server

[LINUX] Factorio Headless Server Guide

So, with credit to the Factorio wiki and cbednarski's helpful gist, I managed to eventually setup a Factorio headless server. Although, I thought the process could be nailed down/simplified to be a bit more 'tutorialised' and also to document how I got it all working for my future records.

The specific distro/version I'm using for this guide being Ubuntu Server 16.04.1 LTS. Although, that shouldn't matter, as long as your distro supports systemd (just for this guide, not a Factorio headless requirement, although most distros use it as standard now). The version of Factorio I shall be using is 0.14.20, although should work for any version of Factorio 0.14.12 and higher.

Just a note to newcomers: If there are any issues with the installation steps, people in the comments are doing a good job