Skip to content

Instantly share code, notes, and snippets.

View carlohcs's full-sized avatar
🎯
Focusing on my Postgraduate degree!

Carlos Santana carlohcs

🎯
Focusing on my Postgraduate degree!
View GitHub Profile
@araujo88
araujo88 / vulnerability_check.sh
Created April 2, 2024 10:21
Check for liblzma vulnerability in sshd
#!/bin/bash
set -u
set -x # Print commands and their arguments as they are executed.
# find path to liblzma used by sshd
path="$(ldd $(which sshd) | grep liblzma | grep -o '/[^ ]*')" || echo "liblzma not found for sshd"
# If the path is empty, the script will now continue instead of exiting due to set -e being removed.
if [ "$path" == "" ]
@paulmwatson
paulmwatson / cypress_test_404_spec.js
Created January 14, 2021 08:33
Testing a 404 page with Cypress
cy.visit('/404')
//=> Test fails
cy.visit('/404', {failOnStatusCode: false})
//=> Test passes but does not test the HTTP code was 404
cy.request({url: '/404', failOnStatusCode: false}).its('status').should('equal', 404)
cy.visit('/404', {failOnStatusCode: false})
//=> Test passes, tests that the HTTP code was 404, and tests page was visited
@Icaruk
Icaruk / multipleGitProfiles.md
Last active July 21, 2024 23:25
How to have multiple profiles on git

Last update: 30-01-2024
Last view: 30-01-2024

Step 1

Go to your work folder, mine is located at: F:/Work/EnterpriseName/

And then create a .gitconfig-work with the following data:

@Danziger
Danziger / interval.hook.ts
Last active November 15, 2023 18:00
✨ Declarative useTimeout (setTimeout), useInterval (setInterval) and useThrottledCallback (useCallback combined with setTimeout) hooks for React (in Typescript)
import React, { useEffect, useRef } from 'react';
/**
* Use setInterval with Hooks in a declarative way.
*
* @see https://stackoverflow.com/a/59274004/3723993
* @see https://overreacted.io/making-setinterval-declarative-with-react-hooks/
*/
export function useInterval(
callback: React.EffectCallback,
@cleydyr
cleydyr / biblivre_centos7_install.sh
Last active May 4, 2024 00:19
Script para instalação automatizada do Biblivre 5 no CentOS 7
# Install Postgresql 9.6
sudo yum install -y postgresql-server postgresql-contrib java-1.8.0-openjdk java-1.8.0-openjdk-devel tomcat
sudo postgresql-setup initdb
# Permite a autenticação com senha no Postgres
echo "Habilitando a autenticação com senha no PostgreSQL"
sudo sed -i -e 's/ident$/md5/g' /var/lib/pgsql/data/pg_hba.conf
# Habilita e inicia serviço do PosgreSQL
@yinzara
yinzara / github_bitbucket_multiple_ssh_keys.md
Last active July 10, 2024 15:08
Managing SSH keys and repo cloning using multiple accounts on GitHub and BitBucket

Why Multiple SSH keys?

There are numerous reasons you may need to use multiple SSH keys for accessing GitHub and BitBucket

You may use the same computer for work and personal development and need to separate your work.

When acting as a consultant, it is common to have multiple GitHub and/or BitBucket accounts depending on which client you may be working for.

You may have different projects you're working on where you would like to segregate your access.

@kosamari
kosamari / how_i_got_into_google.md
Last active November 1, 2023 02:16
Google に入るまでの話

Googleに入るまでの話 (Developer Relations)

コンテキスト: https://togetter.com/li/1331865

前提条件

部署

グーグルジャパンではなくてUSの本社での採用の話。私が受けたのはSoftware EngineerではなくてDeveloper Advocate。Engineering組織の下についているのでコーディング面接有り。ただし評価項目がSWEとは異なる。

英語

@steveholgado
steveholgado / - vuejs-sass-environment-variables.md
Created January 16, 2019 20:25
Make environment variables available as Sass variables in Vue.js

Vue.js: Environment variables in Sass

Make environment variables available as Sass variables in Vue.js.

@bernie-haxx
bernie-haxx / Deployment_to_heroku_laravel.md
Last active September 30, 2023 01:57
DEPLOYMENT TO HEROKU LARAVEL

How to Deploy laravel Applications on Heroku.

Heroku-Laravel

Introduction

Welcome to a series of Deploying a Laravel Application.

Laravel applications are deployed on many sites.

I will be taking you through on how to deploy a laravel application which has a database and to be specific, Postgresql Database.

@scmx
scmx / using-details-summary-github.md
Last active June 24, 2024 16:56
Using <details> <summary> expandable content on GitHub with Markdown #details #summary #markdown #gfm #html

How to use <details> <summary> expandable content on GitHub with Markdown

Firstly, what is <details> <summary>?

The HTML Details Element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label can be provided using the <summary> element. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details.

Example