Skip to content

Instantly share code, notes, and snippets.

@rbikbov
rbikbov / how-to-git-patch-diff.md
Created September 18, 2023 12:39 — forked from nepsilon/how-to-git-patch-diff.md
How to generate and apply patches with git? — First published in fullweb.io issue #33

How to generate and apply patches with git?

It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what diff outputs to your local working copy.

You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:

1. Generate the patch:

git diff > some-changes.patch

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@rbikbov
rbikbov / rest-api-response-format.md
Created December 23, 2022 12:12 — forked from igorjs/rest-api-response-format.md
REST API response format based on some of the best practices
@rbikbov
rbikbov / etc | systemd | system | enable-turbo-boost.service
Created October 20, 2022 23:17 — forked from queses/etc | systemd | system | enable-turbo-boost.service
Linux No TurboBoost Fix. Doesn't work with enabled SecureBoot
[Unit]
Description=Enable Turbo Boost on Intel CPUs
[Service]
ExecStart=/bin/sh -c "/usr/sbin/modprobe msr && /root/turbo-boost.sh enable"
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target
########gesture swipe left 4 xte "keydown Shift_L" "keydown Control_L" "key Tab" "keyup Control_L" "keyup Shift_L"
# Configuration file for libinput-gestures.
# Mark Blakeney, Sep 2015
#
# The default configuration file exists at /etc/libinput-gestures.conf
# but a user can create a personal custom configuration file at
# ~/.config/libinput-gestures.conf.
#
# Lines starting with '#' and blank lines are ignored. Currently
<template>
<input type="text" v-model="value" @input="throttledSave">
</template>
<script lang="ts">
import {Vue, Component} from "vue-property-decorator";
@Component
export default class ThrottledInput extends Vue {
value: string = "";
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Pushkinmuseum Donate Widget</title>
</head>
<body>
<!--<script src="https://unpkg.com/vue"></script>-->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://dev.id.art/pushkinmuseum/pushkinmuseumDonateWidget.umd.js"></script>
<template>
<table border="1" width="100%">
<tr v-for="(value, key) in (typeof object === 'object' ? object : [object])" :key="key">
<td>{{ key }}</td>
<td v-if="Array.isArray(value)">
<table border="1" width="100%">
<tr v-for="(item, index) in value" :key="index">
<td>{{ index }}</td>
<td>
<recursive-table :object="item" />
img = 'PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94aHRtbCI+CjxoZWFkPgo8bGluayByZWw9InN0eWxlc2hlZXQiIGhyZWY9Imh0dHBzOi8vY2RuLnN1Y3VyaS5uZXQvc3VjdXJpLWZpcmV3YWxsLWJsb2NrLmNzcyIgLz4KPHNlY3Rpb24gY2xhc3M9ImNlbnRlciBjbGVhcmZpeCI+CjxtZXRhIG5hbWU9InZpZXdwb3J0IiBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgsIGluaXRpYWwtc2NhbGU9MS4wIiAvPgo8dGl0bGU+U3VjdXJpIFdlYlNpdGUgRmlyZXdhbGwgLSBBY2Nlc3MgRGVuaWVkPC90aXRsZT4KPGxpbmsgaHJlZj0iaHR0cHM6Ly9mb250cy5nb29nbGVhcGlzLmNvbS9jc3M/ZmFtaWx5PU9wZW4rU2Fuczo0MDAsMzAwLDYwMCw3MDAiIHJlbD0ic3R5bGVzaGVldCIgdHlwZT0idGV4dC9jc3MiPgo8L2hlYWQ+Cjxib2R5Pgo8ZGl2IGlkPSJtYWluLWNvbnRhaW5lciI+CjxoZWFkZXIgY2xhc3M9ImFwcC1oZWFkZXIgY2xlYXJmaXgiPgo8ZGl2IGNsYXNzPSJ3cmFwIj4KPGEgaHJlZj0iaHR0cHM6Ly93d3cuc3VjdXJpLm5ldC8/dXRtX3NvdXJjZT1maXJld2FsbF9ibG9jayIgY2xhc3M9ImxvZ28iPjwvYT4KPHNwYW4gY2xhc3M9ImxvZ28tbmVhcnRleHQiPldlYnNpdGUgRmlyZXdhbGw8L3NwYW4+CjxhIGhyZWY9Imh0dHBzOi8vc3VjdXJpLm5ldC8/dXRtX3NvdXJjZT1maXJld2FsbF9ibG9jayIgY2xhc3M9InNpdGUtbGluayI+QmFjayB0byBzdWN1cmkubmV0PC9hPgo8L2Rpd
{
"error": {
"data": {
"name": "werkzeug.exceptions.BadRequest",
"exception_type": "internal_error",
"arguments": [],
"debug": "Traceback (most recent call last):\n File \"/mnt/odoo-source/odoo/http.py\", line 653, in _handle_exception\n return super(JsonRequest, self)._handle_exception(exception)\n File \"/mnt/odoo-source/odoo/http.py\", line 312, in _handle_exception\n raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])\n File \"/mnt/odoo-source/odoo/tools/pycompat.py\", line 87, in reraise\n raise value\n File \"/mnt/odoo-source/odoo/http.py\", line 695, in dispatch\n result = self._call_function(**self.params)\n File \"/mnt/odoo-source/odoo/http.py\", line 320, in _call_function\n raise werkzeug.exceptions.BadRequest(msg % params)\nwerkzeug.exceptions.BadRequest: 400: Bad Request\n",
"message": "400: Bad Request"
},
"message": "Odoo Server Error",