Skip to content

Instantly share code, notes, and snippets.

View Barolina's full-sized avatar

꧁꧂Larisa Barolina

View GitHub Profile
@dgmorales
dgmorales / Makefile
Last active October 9, 2024 09:53
Example Makefile for creating deb/rpm packages with jordansissel/fpm
# This is an example Makefile for quick package creation
#
# It uses FPM [1] to generate simple packages.
# - If you need more features or a greater quality package, use debian
# standard tools for packaging.
# - Do not use checkinstall. Use FPM instead.
#
# [1] (https://github.com/jordansissel/fpm/wiki)
# IMPORTANT:
@jzmiller1
jzmiller1 / example_code.py
Created June 4, 2016 05:30
Terrible Things
class UUIDIdMixin(models.Model):
class Meta:
abstract = True
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
class Body(UUIDIdMixin):
name = models.CharField(max_length=140)
description = models.CharField(max_length=280)
@Barolina
Barolina / bootstrap-tables2.css
Created May 17, 2016 11:15 — forked from dyve/bootstrap-tables2.css
Bootstrap template for django-tables2 (https://github.com/bradleyayers/django-tables2), currently depends on django-bootstrap-toolkit (https://github.com/dyve/django-bootstrap-toolkit)
.table-container th.asc:after {
content: '\0000a0\0025b2';
}
.table-container th.desc:after {
content: '\0000a0\0025bc';
}
.pagination {
text-align: center;
}
@ceolson01
ceolson01 / mixins.py
Created March 19, 2016 15:05
Django Group Required Mixin
from django.core.exceptions import PermissionDenied
class GroupRequiredMixin(object):
"""
group_required - list of strings, required param
"""
group_required = None
@kravchenkor
kravchenkor / gulpfile.js
Created March 14, 2016 16:07
gulp settings
var gulp = require('gulp'), // Подключаем Gulp
sass = require('gulp-sass'), //Подключаем Sass пакет,
browserSync = require('browser-sync'), // Подключаем Browser Sync
concat = require('gulp-concat'), // Подключаем gulp-concat (для конкатенации файлов)
uglify = require('gulp-uglifyjs'), // Подключаем gulp-uglifyjs (для сжатия JS)
cssnano = require('gulp-cssnano'), // Подключаем пакет для минификации CSS
rename = require('gulp-rename'), // Подключаем библиотеку для переименования файлов
del = require('del'), // Подключаем библиотеку для удаления файлов и папок
imagemin = require('gulp-imagemin'), // Подключаем библиотеку для работы с изображениями
pngquant = require('imagemin-pngquant'), // Подключаем библиотеку для работы с png
@Anuragjain89
Anuragjain89 / master-slave-notes.rb
Last active February 6, 2023 12:22
Notes on postgres master slave configuration.
REFERENCES
# https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-on-postgresql-on-an-ubuntu-12-04-vps
# https://sonnguyen.ws/replication-master-slave-with-postgresql-9-4-in-ubuntu-14-04/
# http://senvichet.com/how-to-setup-postgres-9-4-master-slave-streaming-replication/
============================================================================================================
INITIAL STEPS FOR BOTH MASTER AND SLAVE
============================================================================================================
# -----------------------------------------------------------------------------------------------------------
TODO ( STEPS SIMILAR TO SETTING UP AN EC2 INSTANCE ): Install essential software dependencies after system upgrade
# -----------------------------------------------------------------------------------------------------------
@vasanthk
vasanthk / System Design.md
Last active April 19, 2025 20:36
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@bftanase
bftanase / secure_link.php
Last active March 17, 2025 20:25
generate URL for nginx secure_link
@synotna
synotna / FieldPermissionsMixin
Created July 15, 2015 13:01
Field permissions mixin for Django Rest Framework
class FieldPermissionsMixin(object):
"""
A Serializer mixin for controlling which fields are included based on user permissions
Usage:
class MySerializer(FieldPermissionsMixin, serializers.ModelSerializer):
class Meta:
model = MyModel
field_permissions = {
'field': ['app.permission'],
@haxoza
haxoza / admin.py
Created April 17, 2015 09:03
Django custom user model & custom admin
from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from .models import *
from forms import UserChangeForm, UserCreationForm
class UserAdmin(auth_admin.UserAdmin):
fieldsets = (
(None, {'fields': ('email', 'password')}),
('Personal info', {'fields': ('first_name', 'last_name', 'twitter', 'photo', 'event')}),