Skip to content

Instantly share code, notes, and snippets.

View danjesus's full-sized avatar
🏠
Working from home

Dan Jesus danjesus

🏠
Working from home
View GitHub Profile
@bvis
bvis / Jenkinsfile
Last active January 3, 2023 20:45
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"
@felipefialho
felipefialho / css-empty.md
Last active November 24, 2016 20:42
[CSS Trick] Hide dynamic element that break the layout when it is empty.

Hide dynamic element that break the layout when it is empty.

&:empty
  display none

!important, it can't have space on HTML

✌️

@danielrw7
danielrw7 / replify
Last active October 24, 2023 12:03
replify - Create a REPL for any command
#!/bin/sh
command="${*}"
printf "Initialized REPL for `%s`\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "%s> " "$command"
@gustavo-rodrigues-dev
gustavo-rodrigues-dev / removeByExtension.sh
Last active August 9, 2016 18:11
Remove recusive file by extension or by time sh
find . -name "*.DS_Store" -type f -delete
handler: () => {
return this.data.load().then(() => {
return alert.dismiss();
}).then(() => {
this.nav.pop();
});
return false;
}
#!/usr/bin/env python2.7
from __future__ import print_function
import commands
import os
import stat
from gitlab import Gitlab
def get_clone_commands(token, repo_root):
con = Gitlab("http://gitlab.your.domain", token)
@josteink
josteink / on_stateful_code.txt
Last active October 21, 2020 05:37
On why stateful code is bad
On why stateful code is bad
===========================
STUDENT: Sir, can I ask a question?
TEACHER: Yes!
STUDENT: How do you put an elephant inside a fridge?
TEACHER: I don't know.
STUDENT: It's easy, you just open the fridge and put it in. I have another question!
TEACHER: Ok, ask.
STUDENT: How to put a donkey inside the fridge?
@nelsonsar
nelsonsar / example.php
Created September 10, 2015 17:59
Where traits may be useful
<?php
interface InputStream
{
public function close();
public function read($numberOfBytes);
public function skip($numberOfBytes);
}
interface MarkableStream
@nelsonsar
nelsonsar / distance_between_head_commit.sh
Created September 4, 2015 21:10
Calculate distance between HEAD and a given hash
#!/bin/bash
COUNTER=1
for i in $(git log --oneline | cut -d" " -f 1); do
let COUNTER+=1
if [ "$i" = "$1" ]; then
echo "$COUNTER"
fi
done