Skip to content

Instantly share code, notes, and snippets.

View burnash's full-sized avatar
💭
I may be slow to respond.

Anton Burnashev burnash

💭
I may be slow to respond.
View GitHub Profile
Rank Type Prefix/Suffix Length
1 Prefix my+ 2
2 Suffix +online 6
3 Prefix the+ 3
4 Suffix +web 3
5 Suffix +media 5
6 Prefix web+ 3
7 Suffix +world 5
8 Suffix +net 3
9 Prefix go+ 2
@daniepetrov
daniepetrov / fix.md
Last active January 15, 2021 12:14
How to Fix Blurry Fonts in MacOS Mojave / Catalina for Non-Retina Displays
defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO
defaults -currentHost write -globalDomain AppleFontSmoothing -int 1

Light font smoothing defaults command (my selection):

defaults -currentHost write -globalDomain AppleFontSmoothing -int 1
@Fohlen
Fohlen / dropzone-german-dict.js
Created July 7, 2017 10:59
Dropzone.js german localization
export default {
'dictDefaultMessage': 'Legen Sie Dateien hier ab um Sie hochzuladen',
'dictFallbackMessage': 'Ihr Browser unterstützt Drag&Drop Dateiuploads nicht',
'dictFallbackText': 'Benutzen Sie das Formular um Ihre Dateien hochzuladen',
'dictFileTooBig': 'Die Datei ist zu groß. Die maximale Dateigröße beträgt {{maxFileSize}}MB',
'dictInvalidFileType': 'Eine Datei dieses Typs kann nicht hochgeladen werden',
'dictResponseError': 'Der Server hat ihre Anfrage mit Status {{statusCode}} abgelehnt',
'dictCancelUpload': 'Hochladen abbrechen',
'dictCancelUploadConfirmation': null,
'dictRemoveFile': 'Datei entfernen',
@wojteklu
wojteklu / clean_code.md
Last active July 8, 2024 19:27
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@elleryq
elleryq / changepassword.sh.j2
Last active June 13, 2023 13:24
Create Django super user in ansible
#!/usr/bin/expect
set timeout -1;
spawn {{django_dir}}/venv/bin/python manage.py changepassword {{admin_user}};
expect {
"Password:" { exp_send "{{admin_pass}}\r" ; exp_continue }
"Password (again):" { exp_send "{{admin_pass}}\r" ; exp_continue }
eof
}
@lambdahands
lambdahands / _readme.md
Created September 28, 2015 17:09
FlowType and CSS Modules

Huh?

So basically FlowType doesn't know about CSS Modules, a really handy way of dealing with the plagues of CSS in codebases (global variables and dependency wackiness mainly).

What WebPack allows us to do is "require" CSS files and use their class names:

import styles from "my_styles.css";
import React from "react";
@whacked
whacked / celerypolling.py
Created August 29, 2014 06:34
minimal runnable example of Flask + celery worker + jquery progress polling
'''
testing celery progress reporting/polling
* start server
python tempserver.py
* start worker
celery -A tempserver worker -c 1 --loglevel=DEBUG
@JulienPalard
JulienPalard / curry.py
Created August 1, 2014 10:51
KISS Python curry
#!/usr/bin/env python
def curry(func):
"""
Decorator to curry a function, typical usage:
>>> @curry
... def foo(a, b, c):
... return a + b + c
@Nagyman
Nagyman / workflows-in-django.md
Last active June 9, 2024 05:44
Workflows in Django

Workflows (States) in Django

I'm going to cover a simple, but effective, utility for managing state and transitions (aka workflow). We often need to store the state (status) of a model and it should only be in one state at a time.

Common Software Uses

  • Publishing (Draft->Approved->Published->Expired->Deleted)
#!/bin/bash
usage ()
{
cat <<UsageHERE
boot2docker-fwd -- Helper function to quickly manage port forwards between the boot2docker-vm and the host
Usage: boot2docker-fwd [ -n RULE_NAME ] [ -h HOST_PORT ] [ -p {tcp|udp} ] [ -i HOST_IP ] GUEST_PORT
or boot2docker-fwd -d RULE_NAME
or boot2docker-fwd -l
or boot2docker-fwd -A