Skip to content

Instantly share code, notes, and snippets.

View tkrempser's full-sized avatar

Thiago Krempser tkrempser

View GitHub Profile
@MahirMahbub
MahirMahbub / .platform:hook:postdeploy:01_create_celery_service.sh
Last active May 17, 2023 06:40
Config for AWS Beanstalk Linux 2 Django Celery Deployment with Amazon SQS
#!/usr/bin/env bash
# Create the celery systemd service file
echo "[Unit]
Name=Celery
Description=Celery service for __
After=network.target
StartLimitInterval=0
[Service]
@Alex3917
Alex3917 / celery_configs
Created September 1, 2020 01:47
How to configure Celery using Elastic Beanstalk with Amazon Linux 2
# In .ebextensions/01_celery.config
files:
"/etc/systemd/system/celery.service":
mode: "000644"
owner: celery
group: celery
content: |
[Unit]
Description=Celery Service
@mutewinter
mutewinter / commit_format_examples.txt
Created March 19, 2014 18:52
Examples of my commit format.
chore: add Oyster build script
docs: explain hat wobble
feat: add beta sequence
fix: remove broken confirmation message
refactor: share logic between 4d3d3d3 and flarhgunnstow
style: convert tabs to spaces
test: ensure Tayne retains clothing
@mutewinter
mutewinter / commit_format.txt
Created March 19, 2014 18:52
My commit message format.
feat: add hat wobble
^--^ ^------------^
| |
| +-> Summary in present tense.
|
+-------> Type: chore, docs, feat, fix, refactor, style, or test.
class Entity(models.Model):
somefile = model.FileField(upload_to='files')
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active March 11, 2024 16:13
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@codeguy
codeguy / slugify.js
Created September 24, 2013 13:19
Create slug from string in Javascript
function string_to_slug (str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}
@sgmurphy
sgmurphy / url_slug.js
Created July 12, 2012 02:05
URL Slugs in Javascript (with UTF-8 and Transliteration Support)
/**
* Create a web friendly URL slug from a string.
*
* Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>