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}
@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})();
@Oberon00
Oberon00 / funcidx.lua
Last active May 13, 2024 09:42
Lua C API function HTML reference table data & generator (http://oberon00.github.io/lua-cfuncidx/index.html)
-- Helpers {{{1
local function fail_on_missing_tbl(t, missing_name)
missing_name = missing_name or 'table entry'
return setmetatable(t, {__index = function(t, k)
error(('No %s with key "%s" (in %s).'):format(missing_name, k, t))
end
})
end
fail_on_missing_tbl(_G, 'global');
@pulkitsinghal
pulkitsinghal / README.md
Last active May 13, 2024 09:40
How can a nodejs process running inside a docker container, get that container's id?

Problem

How can a nodejs process running inside a docker container, get that container's id?

Solution

the hostname seems to be the short container id in Docker v1.12

It works and this idea was found in this SO post.

@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active May 13, 2024 09:39
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@whaison
whaison / deleteEmptyAnimLayers.mel
Created September 15, 2016 12:37
///////AutoMayaBatch_CharaDir_v003.bat で動かすためにlayerEditor.melから抜粋 deleteEmptyAnimLayers.mel
///////AutoMayaBatch_CharaDir_v003.bat で動かすためにlayerEditor.melから抜粋
// Copyright (C) 1997-2014 Autodesk, Inc., and/or its licensors.
// All rights reserved.
//
// The coded instructions, statements, computer programs, and/or related
// material (collectively the "Data") in these files contain unpublished
// information proprietary to Autodesk, Inc. ("Autodesk") and/or its licensors,
// which is protected by U.S. and Canadian federal copyright law and by
// international treaties.
//