Skip to content

Instantly share code, notes, and snippets.

View cdecarlos's full-sized avatar

Carlos Martí Huerta cdecarlos

  • Valencia, Spain
  • 01:41 (UTC +02:00)
View GitHub Profile
@cdecarlos
cdecarlos / rename_old_git_tag.md
Created January 21, 2022 12:55
Rename old git tag

How rename old git tag

Step 1: Create a new tag on the same commit point of old tag and push it.

git tag new_tag old_tag
git push --tags

Step 2: Delete the old tag from local repo.

// START insertAndExecute function
function insertAndExecute(id, text) {
domelement = document.getElementById(id);
domelement.innerHTML = text;
var scripts = [];
ret = domelement.childNodes;
for (var i = 0; ret[i]; i++) {
if (
scripts &&

Groups on Docker compose

How to create groups in docker-compose

Create different docker-compose.yml for each projects

Example:

  • moodle35.yml
  • moodle39.yml
@cdecarlos
cdecarlos / sourceTree_device_not_configured.txt
Created February 17, 2021 16:40 — forked from RockinPaul/sourceTree_device_not_configured.txt
SourceTree: Device not configured (on MacOS)
In console:
git config credential.helper
You will see: osxkeychain
git config credential.helper sourcetree
Then if you perform git config credential.helper again
You will see: sourcetree
@cdecarlos
cdecarlos / README.md
Created February 3, 2021 13:14
Template README.md

Project name

Description.

Install

How to install?

Use

@cdecarlos
cdecarlos / cookies.js
Created February 1, 2021 18:58
Simple code to get and set cookies on browser
var cookieTimeExpire = 30 * 24 * 60 * 60 * 1000
/**
* Set cookie
* @param {string} name
* @param {string} value
*
* @return {void}
*/
function setCookie (name, value) {
@cdecarlos
cdecarlos / fastCheck.js
Last active January 19, 2021 16:29
Method for check if value exists on array
Array.prototype.fastCheck = function (search) {
let obj = {}
this.forEach(el => {
obj[el] = el
})
if (obj[search]) {
return true
} else {
return false
}