Skip to content

Instantly share code, notes, and snippets.

View barrosohub's full-sized avatar

Barroso Filho barrosohub

View GitHub Profile
@sdiama
sdiama / webview.js
Created May 29, 2019 17:47
React Native: Handle hardware back button @ webview
import React, { Component } from 'react';
import { WebView, BackHandler } from 'react-native';
export default class WebViewMoviezSpace extends Component {
constructor(props) {
super(props);
this.WEBVIEW_REF = React.createRef();
}
componentDidMount() {
@caironm
caironm / validate.php
Created April 26, 2019 23:31
Funções
<?php
/* CHECK IF A $STRING IS INT. */
function isNumeric($string){
if (!filter_var($string, FILTER_VALIDATE_INT))
return false;
else
return true;
}
@paulofreitas
paulofreitas / security-http-headers.md
Last active June 11, 2021 16:22
Cabeçalhos de resposta HTTP relacionados a segurança

Content-Security-Policy, X-Content-Security-Policy, X-WebKit-CSP

O cabeçalho de resposta HTTP Content-Security-Policy permite aos administradores de sites controlar os recursos que o navegador ou agente de usuário (user agent) pode carregar em uma determinada página. Com algumas exceções, as políticas envolvem principalmente especificar as origens do servidor e os endpoints de script. Isso ajuda a proteger contra ataques de XSS.

O cabeçalho de respsota HTTP X-Content-Security-Policy é requerido para implementar o CSP no Internet Explorer 10 e 11.

O cabeçalho de resposta HTTTP X-Webkit-CSP é requerido para implementar o CSP em versões mais antigas do Google Chrome, Safari e outros navegadores baseados na engine WebKit.

Para navegadores modernos, o cabeçalho Content-Security-Policy deve ser usado.

@jimmywarting
jimmywarting / readme.md
Last active July 4, 2024 11:58
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@PartTimeLegend
PartTimeLegend / vboxdrvfix.md
Last active September 24, 2019 01:44
/etc/init.d/vboxdrv setup Not Found - VirtualBox Fix!

#/etc/init.d/vboxdrv setup Not Found - VirtualBox Fix!

When setting up Virtual Box I was faced with the immortal error telling me to run sudo /etc/init.d/vboxdrv setup. Simple enough, until you're told it doesn't exist.

Thus began my fight to get it working. The fix is here in the hope that it helps someone else.

To follow this guide you need to have a basic understanding of shell commands. If you don't, then just be careful.

First off I like aptitute so let's install it.