Skip to content

Instantly share code, notes, and snippets.

View ekinertac's full-sized avatar
🥳

Ekin Ertaç ekinertac

🥳
View GitHub Profile
@ekinertac
ekinertac / YourProjectEditorModule.cpp
Created April 2, 2024 00:54 — forked from intaxwashere/YourProjectEditorModule.cpp
Automatically adding category sections to editor
// add this code to your StartupModule() function of your EDITOR module
// if it doesnt work, try setting loading phase to "postdefault" -- no idea if this will produce side effects though.
// basically idea is looping all CDOs (i.e. UClasses) and their properties, getting their "category" meta value and registering them to
// property sections
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
static constexpr bool bAddSubcategories = false; // you probably want this to be false
auto ProcessCategory = [&PropertyModule](const FName ClassName, const FString& Category)
@ekinertac
ekinertac / audio2midi.md
Created March 21, 2024 21:05 — forked from natowi/audio2midi.md
List of open source audio to midi packages
@ekinertac
ekinertac / swagger.dark.css
Created February 16, 2022 14:45
add this at the end of the swagger's css file
body.swagger-body {
background: #3b4151;
}
h1, h2, h3, h4, h5, h6, pre {color: #fff!important;}
.swagger-ui .scheme-container {
background: #3b4151;
}
@ekinertac
ekinertac / views.py
Last active March 23, 2021 05:10
Django simple background tas runner
import threading
from .models import Crawl
def startCrawl(request):
task = Crawl()
task.save()
t = threading.Thread(target=doCrawl,args=[task.id],daemon=True)
t.start()
return JsonResponse({'id':task.id})
// Usage:
//
// colorShader(10, '#f50'); // brighten color 10%
// colorShader(-10, '#f50'); // darken color 10%
//
// colorShader(10, '#f50', '#0ad74e'); // blend two colors
// colorShader(10, 'rgb(210, 200, 20)', 'rgb(20,156,210)'); // blend two colors
const colorShader = (ratio=10, color1, color2 = false) => {
let p = ratio / 100;
ps -ylC apache2 | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
@ekinertac
ekinertac / admin.py
Created April 23, 2019 11:23
CssClassMixin for Django-Admin form elements
class PostAdmin(CssClassMixin, admin.ModelAdmin):
form_css_clasess = {
'title': 'col-sm-8',
'slug': 'col-sm-12'
}
@ekinertac
ekinertac / pyenv+virtualenv.md
Created June 1, 2018 12:19 — forked from eliangcs/pyenv+virtualenv.md
Cheatsheet: pyenv, virtualenvwrapper, and pip

Cheatsheet: pyenv, virtualenvwrapper, and pip

Installation (for Mac OS)

Install pyenv with brew

brew update
brew install pyenv
@ekinertac
ekinertac / s3storages.settings.py
Last active April 11, 2018 03:47
Django's Amazon S3 Configuration
#
# Install django-storages app with pip
# $ pip install django-storages
#
INSTALLED_APPS = (
...
'storages',
...
)
@ekinertac
ekinertac / sqlite3_to_mysql.md
Last active April 11, 2018 03:48
Converts sqlite3 database dumps to mysql dump format
sqlite3 databse.db .dump > sqlite3_database_dump.sql
python sqlite3_to_mysql.py database.sql > mysql_database_dump.sql