Skip to content

Instantly share code, notes, and snippets.

View pedronaves's full-sized avatar

pedro naves pedronaves

View GitHub Profile
@pedronaves
pedronaves / trim-macos.md
Created March 14, 2023 21:04
Habilitar Trim em SSD - MacOS 10.7.5 ~ 10.9.5

Habilitar TRIM em SSD's de terceiros no MacOS

Nota: Testado anteriormente na versão 10.7.5 (Lion)

Execute o comando apropriado para sua versão no terminal

Salvando arquivo original:

sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage-backup
@pedronaves
pedronaves / Setup printer HP P1102w on MacOS
Last active March 16, 2026 11:31
Setup printer HP P1102w on MacOS
HOW TO SET UP HP LASERJET P1102W ON MAC OS
How to connect using Wi-Fi Protected Setup (WPS)?
Note: If your router does not support WPS, use the wireless setup method using a USB cable.
1.Make sure your computer, router and printer are all turned on. Connect your computer to a wireless network.
2.Press the WPS button on your wireless router.
3.On the printer control panel, press the Wireless button. The wireless light starts to blink.
@pedronaves
pedronaves / install-comodo-ssl-cert-for-nginx.rst
Created June 2, 2018 03:01 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@pedronaves
pedronaves / git_revert.md
Created February 2, 2018 10:31 — forked from todgru/git_revert.md
how to use git revert --strategy resolve

Oh yes, this is nice:

git revert --strategy resolve <sha-ish>

Given a git log of A--B--C--D--E you can remove commit C using:

git revert --strategy resolve <sha-of-C> 

Which will produce:

@pedronaves
pedronaves / contact_batch_email.html.erb
Created April 2, 2017 23:50 — forked from Joseworks/contact_batch_email.html.erb
Send batch emails on ActiveAdmin Rails 4.2.0
<!-- Contact batch email -->
<!DOCTYPE html>
<html>
<head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
</head>
<body>
<div>Name: <%= @name %></div>
<br>
<div>Subject: <%= @subject %></div>
package fibonacci;
import javax.swing.JOptionPane;
public class Fibonacci {
public static void main(String[] args) {
int n = Integer.parseInt(JOptionPane.showInputDialog("Digite um valor"));
@pedronaves
pedronaves / JavaApplication1.java
Created April 29, 2014 22:34
Recursividade em Java
package javaapplication1;
import javax.swing.JOptionPane;
public class JavaApplication1 {
public static void main(String[] args) {
int n = Integer.parseInt(JOptionPane.showInputDialog("Digite um valor"));
@pedronaves
pedronaves / Ex1a10.c
Created September 25, 2013 11:10
Exercício C, vetor de 1 a 10.
//
// main.c
// exv10
//
// Created by Pedro Naves on 24/09/13.
// Copyright (c) 2013 Pedro Naves. All rights reserved.
//
#include <stdio.h>
01. O coração humano bate em média uma vez por segundo. Desenvolver um algoritmo para calcular e escrever quantas vezes o coração de uma pessoa baterá se viver X anos.
#include<stdio.h>
#include<math.h>
#define batano 365.25
#define batdia 24
#define bathora 60
#define batminuto 60
int main()
{