Skip to content

Instantly share code, notes, and snippets.

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

Bianca Tamayo btamayo

🏠
Working from home
View GitHub Profile
@augustogiles
augustogiles / archive_branches.sh
Last active April 3, 2024 17:21
Based in a branch, all the branches that already merged in it is passive to be archived.
#!/usr/bin/env bash
current_branch=$(git rev-parse --abbrev-ref HEAD)
target_branch=$1
if [ -z "$target_branch" ]
then
target_branch=$current_branch
fi
response="DECIDE"
@yagudaev
yagudaev / cypress_support_hooks.js
Last active September 16, 2021 08:46
Cypress Fetch Support Workaround - replaces fetch request with traditional XHR so cypress can track them
// cypress/support/hooks.js
// Cypress does not support listening to the fetch method
// Therefore, as a workaround we polyfill `fetch` with traditional XHR which
// are supported. See: https://github.com/cypress-io/cypress/issues/687
enableFetchWorkaround()
// private helpers
function enableFetchWorkaround() {
let polyfill
@btamayo
btamayo / regex.sh
Created September 7, 2018 18:43
Useful one-line scripts for sed
# | Source : http://sed.sourceforge.net/sed1line.txt
# | -------------------------------------------------------------------------
# | USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
# | Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5
# |
# | Latest version of this file (in English) is usually at:
# | http://sed.sourceforge.net/sed1line.txt
# | http://www.pement.org/sed/sed1line.txt
# |
# | This file will also available in other languages:
@jglenn9k
jglenn9k / check_page_speed.cpp
Last active July 5, 2018 20:49
Checks page speed
#include <iostream>
#include <string>
#include <cstdio>
#include <curl/curl.h>
// James Glenn <thedonkdonk@gmail.com>
// 2018-03-30
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) {
((std::string*)userp)->append((char*)contents, size * nmemb);
@fredericrous
fredericrous / pipeline.gdsl
Last active September 11, 2019 09:39 — forked from ggarcia24/pipeline.gdsl
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
@gricard
gricard / webpack4upgrade.md
Last active February 29, 2024 20:23
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2
@ggarcia24
ggarcia24 / pipeline.gdsl
Last active June 15, 2024 20:25
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
@enricofoltran
enricofoltran / main.go
Last active June 26, 2024 12:16
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"

To build the image:

$ docker build \
>   --file get-pip.Dockerfile \
>   --tag dhermes/repro-4352:latest \
>   .

After building and running the shell, the import succeeds:

@MoOx
MoOx / README.md
Last active May 11, 2023 13:59
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily