Skip to content

Instantly share code, notes, and snippets.

@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@adibhanna
adibhanna / settings.json
Created April 18, 2024 17:56
zed settings
{
"theme": "Gruvbox Dark Hard",
"base_keymap": "VSCode",
"buffer_font_family": "BerkeleyMono Nerd Font",
"buffer_font_size": 15,
"vim_mode": true,
"relative_line_numbers": true,
"cursor_blink": false,
"scrollbar": {
"show": "never"
@guwidoe
guwidoe / GetLocalOneDrivePath.bas.vb
Last active May 13, 2024 09:49
VBA Function to get the local path of a OneDrive/SharePoint synchronized Microsoft Office file
'Attribute VB_Name = "GetLocalOneDrivePath"
'
' Cross-platform VBA Function to get the local path of OneDrive/SharePoint
' synchronized Microsoft Office files (Works on Windows and on macOS)
'
' Author: Guido Witt-Dörring
' Created: 2022/07/01
' Updated: 2024/04/23
' License: MIT
'
@axelcoezard
axelcoezard / linuxbrew.sh
Created March 19, 2024 09:35
Homebrew on 42 Linux
# Go to your home directory
cd ~
# Clone homebrew repo
git clone https://github.com/Homebrew/brew .linuxbrew
#
eval "$(.linuxbrew/bin/brew shellenv)"
brew update --force --quiet
chmod -R go-w "$(brew --prefix)/share/zsh"
@doino-gretchenliev
doino-gretchenliev / configuration.yaml
Last active May 13, 2024 09:47
Home Assistant RADIUS authentication #home-assistant #homeassistant #radius #authentication #python
homeassistant:
auth_providers:
- type: command_line
command: "/config/auth/radius-auth.sh"
meta: true
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jpp-odoo
jpp-odoo / odoo_server_apple_ARM-based.md
Last active May 13, 2024 09:45
Config Odoo Server on an apple arm based computers (M1 and M2)

Introduction

There is an issue with the python library lxml on apple when parsing an XML file containing emojis, on Odoo this will arrive when trying to install some modules as Project or Knowledge.

The Traceback is :

Traceback (most recent call last):
  File "/Users/odoo/src/odoo-src/odoo/odoo/tools/translate.py", line 310, in xml_translate
    root = parse_xml(value)
@regeter
regeter / Search All.sql
Last active May 13, 2024 09:43
Search All Tables, All Columns
/* Reto Egeter, fullparam.wordpress.com */
DECLARE @SearchStrTableName nvarchar(255), @SearchStrColumnName nvarchar(255), @SearchStrColumnValue nvarchar(255), @SearchStrInXML bit, @FullRowResult bit, @FullRowResultRows int
SET @SearchStrColumnValue = '%searchthis%' /* use LIKE syntax */
SET @FullRowResult = 1
SET @FullRowResultRows = 3
SET @SearchStrTableName = NULL /* NULL for all tables, uses LIKE syntax */
SET @SearchStrColumnName = NULL /* NULL for all columns, uses LIKE syntax */
SET @SearchStrInXML = 0 /* Searching XML data may be slow */
@MangelMaxime
MangelMaxime / Async.hx
Last active May 13, 2024 09:43
Demonstrate how to use native async/await from JavaScript with haxe.
package async;
#if macro
import haxe.macro.Context;
#end
class Async {
public static macro function async(expr:haxe.macro.Expr) {
expr = Context.storeTypedExpr(Context.typeExpr(expr));
return macro untyped __js__("(async {0})", ${expr})();