Skip to content

Instantly share code, notes, and snippets.

Zero Dragon ZeroDragon

Block or report user

Report or block ZeroDragon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ZeroDragon
ZeroDragon / docker-compose.yml
Created Mar 28, 2019
Custom loggig in docker-compose
View docker-compose.yml
version: '3.1'
services:
my-service:
logging:
driver: "json-file"
options:
max-size: "50m"
image: ......
@ZeroDragon
ZeroDragon / betterlogger.js
Created Jul 26, 2018
Replace console.log
View betterlogger.js
/* globals ENV */
let environment = 'dev'
if (typeof ENV === 'undefined') environment = 'prod'
const logger = {}
const sty = color => `padding:4px;color:#fff;background-color:${color};`
const loggerTypes = {
debug: sty('green'),
info: sty('blue'),
warn: sty('orange'),
@ZeroDragon
ZeroDragon / labelnator.sh
Last active Jul 5, 2018
Para meter las labels a los repos de RTD
View labelnator.sh
#!/bin/sh
REPO=resuelve/$1
TOKEN=$2
labels=(
'{"name": "Bug 🐛", "description": "MUCHO ROJO!!!", "color": "d73a4a"}'
'{"name": "Documentación 📗", "description": "Documentación", "color": "a369ef"}'
'{"name": "Epic", "description": "Épica", "color": "3E4B9E"}'
'{"name": "Hackday 💡", "description": "Puntos extras por mejora muy opcional", "color": "5319e7"}'
View Rangemap.js
class Rangemap {
constructor (input, output) {
this.inMin = input[0]
this.inMax = input[1]
this.outMin = output[0]
this.outMax = output[1]
}
transport (value, trim = false) {
let retval = (value - this.inMin) *
(this.outMax - this.outMin) / (this.inMax - this.inMin) +
View retagger.sh
#!/bin/sh
echo "Last tag is:"
git tag | sed -e '$!d'
echo "Want to tag current commit? type the name of the tag (leave empty to skip)"
read current
if [ "$current" != "" ]; then
git tag -a $current
fi
echo "Type the name of the tag you want to move (leave blank to skip)"
View RETAGGER.md

Rettager

This file will help you to create tags in your git repository.
Also you can use it to move a tag from commit to commit (for build tags).

Usage

Just add retagger.sh to anyplace you want (bin maybe) and add execution permissions.
Also you can just leave it in your Documents or Downloads and just add an alias in your .bashrc file

View generate-pushid.coffee
###*
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
###
@ZeroDragon
ZeroDragon / app.coffee
Last active Sep 28, 2016
Slack File Deleter
View app.coffee
###*
* Confugure HERE
###
token = "Slack-Token" #Slack token
domain = "myTeamName" #Your team name
maxCool = 10 #Max retries to get files list
days = 7 #Keep this days of files
###*
* Stop editing
###
@ZeroDragon
ZeroDragon / consoleImage.coffee
Last active Apr 10, 2016
image on dev tools for chrome
View consoleImage.coffee
if console?.log?
url = "http://i.imgur.com/oGiMR.gif"
getBox = (width, height)->
return {
string: "+",
style: "font-size: 1px; padding: " + Math.floor(height/2) + "px " + Math.floor(width/2) + "px; line-height: " + height + "px;"
}
img = new Image()
img.onload = ->
dim = getBox(@.width, @.height);
View README.md

First plugin test...

You can’t perform that action at this time.