Skip to content

Instantly share code, notes, and snippets.

@dmmeteo
dmmeteo / 1.srp.py
Last active June 7, 2024 14:11
SOLID Principles explained in Python with examples.
"""
Single Responsibility Principle
“…You had one job” — Loki to Skurge in Thor: Ragnarok
A class should have only one job.
If a class has more than one responsibility, it becomes coupled.
A change to one responsibility results to modification of the other responsibility.
"""
class Animal:
def __init__(self, name: str):
@bpereto
bpereto / drf-rules-permission-class-with-httpmethod-map.py
Last active November 28, 2019 09:19
Django Restframework Rules Permission integration with HTTPMethod Map
"""
Django REST Framework Permission Class for Django Rules
"""
from rest_framework import permissions, exceptions
from rest_framework.viewsets import ModelViewSet
from django.http import Http404
class DjangoRulesMethodObjectPermissions(permissions.BasePermission):
"""
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API

Buttons

- import RaisedButton from 'material-ui/RiasedButton';
+ import Button from '@material-ui/core/Button';
- import ArrowBack from 'material-ui/svg-icons/navigation/arrow-back';
+ import ArrowBack from '@material-ui/icons/ArrowBack';
import { Link } from 'react-router-dom';

+ const styles = theme => ({
@chetstone
chetstone / patch33x.sh
Created April 15, 2018 23:29
Patching React-Native in a script run by npm/yarn postinstall
#!/bin/sh
# Fix RN version 33
yarn list react-native |grep react-native |grep 0.33
if [ $? -eq 0 ];
then
echo "Checking that ReactNative v 33 is patched"
cd node_modules/react-native
patch -N -p1 --dry-run --silent < ../../notes/rn33.3x.patch >/dev/null 2>&1
if [ $? -eq 0 ];
@Warchant
Warchant / sonarqube-docker-compose.yml
Last active May 28, 2024 20:24
docker-compose file to setup production-ready sonarqube
version: "3"
services:
sonarqube:
image: sonarqube
expose:
- 9000
ports:
- "127.0.0.1:9000:9000"
networks:
//
// Swizzle.swift
// RouterTester
//
// Created by Ivan Bruel on 17/05/2017.
// Copyright © 2017 Unbabel. All rights reserved.
//
import Foundation
import ObjectiveC
@dispix
dispix / CHANGELOG.md
Last active June 26, 2024 09:36
OAUTH2 Authentication and token management with redux-saga

Revision 5

  • Fix error parsing

Revision 4

  • Add missing yield in the login function

Revision 3

@colophonemes
colophonemes / create_triggers
Last active February 17, 2024 15:15
Postgres TRIGGER to call NOTIFY with a JSON payload
CREATE TRIGGER person_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
'email',
'username'
);
CREATE TRIGGER income_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
@JeansBolong
JeansBolong / Magento2.md
Last active April 2, 2023 06:50
Magento2 CheatSheet

Magento 2 tutorial

http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/bk-frontend-dev-guide.html
https://www.creare.co.uk/blog/magento/theming-in-magento-2-part-1
https://www.creare.co.uk/blog/magento/theming-in-magento-2-part-2
http://alanstorm.com/category/magento-2/

I have installed Magento 2 successfully, but icons are not displaying and not able to click anywhere in backend.

Please try running following command.