Skip to content

Instantly share code, notes, and snippets.

View guibranco's full-sized avatar
🎯
Focusing

Guilherme Branco Stracini guibranco

🎯
Focusing
View GitHub Profile
@guibranco
guibranco / Dockerfile
Last active March 20, 2024 18:29
Docker file for PHP 7.4 with Apache, MySQLi extension, GD2 and Apache mod_rewrite enabled
FROM php:7.4-apache
RUN apt-get update
RUN apt-get install --yes --force-yes cron g++ gettext libicu-dev openssl libc-client-dev libkrb5-dev libxml2-dev libfreetype6-dev libgd-dev libmcrypt-dev bzip2 libbz2-dev libtidy-dev libcurl4-openssl-dev libz-dev libmemcached-dev libxslt-dev
RUN a2enmod rewrite
RUN docker-php-ext-install mysqli
RUN docker-php-ext-enable mysqli
@guibranco
guibranco / Dockerfile
Last active March 4, 2024 11:17
Docker file for PHP 5.6 with Apache, MySQL extension, GD2 and Apache mod_rewrite enabled
FROM php:5.6-apache
RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \
-e 's|security.debian.org|archive.debian.org/|g' \
-e '/stretch-updates/d' /etc/apt/sources.list
RUN apt-get update
RUN apt-get install --yes --force-yes cron g++ gettext libicu-dev openssl libc-client-dev libkrb5-dev libxml2-dev libfreetype6-dev libgd-dev libmcrypt-dev bzip2 libbz2-dev libtidy-dev libcurl4-openssl-dev libz-dev libmemcached-dev libxslt-dev
RUN a2enmod rewrite
@guibranco
guibranco / build-deploy.yml
Last active February 16, 2024 01:17
Sample CI GitHub Action file for .NET 8
name: CI
on:
push:
branches: [ main ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
@guibranco
guibranco / createIssueIfContentOfFileAndFileExistsViaPostman.js
Last active January 27, 2024 02:14
Create an issue to replace part of a file based on its content (and existence).
const ghToken = pm.globals.get("GH_PAT");
const authorizationHeader = `Authorization: Bearer ${ghToken}`;
const fileName = "appveyor.yml";
const pattern = "ps: $COVERLET_FORMATS = @('cobertura', 'lcov', 'opencover')";
const issueTitle = "Run all coverage formats at once per project";
const issueBody = "**Is your feature request related to a problem? Please describe.**\r\nRun all coverage formats at once per project\r\n\r\n**Describe the solution you'd like**\r\nReplace the actual code:\r\n```ps\r\n- ps: $TEST_PROJECTS = (Get-ChildItem -Path .\Tests\**\ -Recurse -Include *.csproj).Fullname\r\n- ps: $COVERLET_FORMATS = @('cobertura', 'lcov', 'opencover')\r\n- ps: |\r\n foreach($testProject in $TEST_PROJECTS)\r\n {\r\n foreach($coverletFormat in $COVERLET_FORMATS)\r\n {\r\n dotnet test $testProject /p:CollectCoverage=true /p:CoverletOutputFormat=\"$coverletFormat\"\r\n }\r\n }\r\n```\r\n\r\nWith the following code:\r\n```ps\r\n- ps: $TEST_PROJECTS = (Get-ChildItem -Path .\
@guibranco
guibranco / createIssueIfWorkflowExistsViaPostman.js
Created January 27, 2024 01:37
Create issue if a file exists in the repository (a specific workflow file).
const ghToken = pm.globals.get("GH_PAT");
const authorizationHeader = `Authorization: Bearer ${ghToken}`;
const workflowName = "build.yml"
const issueTitle = `Remove \`${workflowName}\``;
const repositories = pm.response.json();
for (let i = 0; i < repositories.length; i++) {
@guibranco
guibranco / generateHTMLfromJSON.js
Last active December 15, 2023 15:42
Generate HTML from repositories list from API response
const jsonData = pm.response.json();
const divPattern = "<div style=\"margin-top: 10px;\">";
const imageUrl = (item) => `https://github-readme-stats-guibranco.vercel.app/api/pin/?username=${item.organization.login}&amp;repo=${item.name}&amp;theme=dark&amp;bg_color=222222&amp;show_owner=true&amp;show_forks=false&amp;show_issues=true`;
const link = (item) => `<a href="${item.url}" target="_blank">${image(item)}</a>`;
const image = (item) => `<img style="min-height: 100px; padding-right: 10px;" src="${imageUrl(item)}" alt="${item.full_name}" />`;
var html = divPattern;
for(let i = 0; i < jsonData.length; i++){
html += link(jsonData[i]);
@guibranco
guibranco / build.yml
Last active December 15, 2023 15:41
Sample build & test GitHub Action file for .NET 8
name: Build
on:
push:
branches:
- '*'
- '*/*'
- '**'
- '!main'
workflow_dispatch:
@guibranco
guibranco / build.yml
Last active December 15, 2023 15:40
Sample build & test GitHub Action file for .NET Framework (MSBuild)
name: Build
on:
push:
branches:
- '*'
- '*/*'
- '**'
- '!main'
paths-ignore:
@guibranco
guibranco / build-deploy.yml
Last active December 15, 2023 15:39
Sample CI GitHub Action file for .NET Framework (MSBuild)
name: CI
on:
push:
branches: [ main ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
@guibranco
guibranco / Dockerfile
Created December 15, 2023 15:33
Docker file for PHP 8.3 with Apache, MySQLi extension, GD2 extension and Apache mod_rewrite enabled
FROM php:8.3-rc-apache
RUN apt-get update
RUN apt-get install --yes --force-yes cron g++ gettext libicu-dev openssl libc-client-dev libkrb5-dev libxml2-dev libfreetype6-dev libgd-dev libmcrypt-dev bzip2 libbz2-dev libtidy-dev libcurl4-openssl-dev libz-dev libmemcached-dev libxslt-dev
RUN a2enmod rewrite
RUN docker-php-ext-install mysqli
RUN docker-php-ext-enable mysqli