Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View MickaelBergem's full-sized avatar
🚀

Mickaël MickaelBergem

🚀
View GitHub Profile
@vineus
vineus / mylist.md
Last active March 9, 2024 22:12
Software engineering links
@NotSqrt
NotSqrt / settings_test_snippet.py
Last active May 1, 2022 01:34 — forked from nealtodd/settings_test_snippet.py
Another shot at this problem ..
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
return "notmigrations"
MIGRATION_MODULES = DisableMigrations()
@kesor
kesor / profile_middleware.py
Last active March 16, 2021 15:37
Django cProfile middleware
from django.core.exceptions import MiddlewareNotUsed
from django.conf import settings
import cProfile
import pstats
import marshal
from cStringIO import StringIO
class ProfileMiddleware(object):
def __init__(self):
if not settings.DEBUG:
@garethrees
garethrees / gist:5591027
Last active October 14, 2020 19:44
Ansible set timezone on Ubuntu host
- name: Group by Distribution
hosts: all
tasks:
- group_by: key=${ansible_distribution}
- name: Set Time Zone
hosts: Ubuntu
gather_facts: False
tasks:
- name: Set timezone variables
@MickaelBergem
MickaelBergem / .gitconfig
Last active October 30, 2015 13:10
GitConfig Dotfiles
[user]
name = ..
email = ..
[core]
editor = nano
excludesfile = ~/.gitexcludes
[push]
default = current
[pull]
default = current
@aldeka
aldeka / blogpost.md
Last active August 29, 2015 14:20
Things I hate: UI patterns the web presentation layer can't pull off

It's a fairly common UI pattern in chat programs. You have a set of people talking in a chatroom, and one person sends multiple messages in a row. Instead of styling each of these messages like one-off messages, you style the additional messages so they appear as a unit with the first message by that author, until interrupted by someone else. You remove horizontal border lines, or you make the message author's name only appear once, or you do some nice thing with padding. Whatever.

Screenshot of Slack exhibiting this message-merging behavior

This is a pretty common pattern. It's also something that obviously ought to be handled by the presentation layer--your application code shouldn't care what order the chat messages happen to come in, and you shouldn't have to add wrapper divs and other jiggery-pokery when subsequent messages come in or get deleted and worry about determining whether this "chunk" of messages is interrupted by other chats or not.

Unless the number

@MickaelBergem
MickaelBergem / git-clean-merged-branches
Last active August 29, 2015 14:11
Remove all local branches that have been merged
# Will remove all merged branches, except the current one.
git remote prune origin && git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
@MickaelBergem
MickaelBergem / owncloud-docker-compose.yml
Created August 26, 2015 23:36
`docker-compose.yml` file for setting up an ownCloud server using a PostgreSQL database
# Composition of the containers
owncloud:
image: owncloud
ports:
- 80:80
volumes_from:
- owncloud-data
links:
- postgres:owncloud-db