Skip to content

Instantly share code, notes, and snippets.

View parag60288's full-sized avatar

Parag Patil parag60288

View GitHub Profile
@craSH
craSH / Password.java
Last active June 12, 2024 05:13
A simple example Java class to safely generate and verify bcrypt password hashes for use in authentication systems.
/**
* Author: Ian Gallagher <igallagher@securityinnovation.com>
*
* This code utilizes jBCrypt, which you need installed to use.
* jBCrypt: http://www.mindrot.org/projects/jBCrypt/
*/
public class Password {
// Define the BCrypt workload to use when generating password hashes. 10-31 is a valid value.
private static int workload = 12;
@james2doyle
james2doyle / pagination.php
Last active August 26, 2023 07:52
Simple pagination element with dot separation when large counts
<div class="pagination size1of1 unit">
<?php if($paged == 1): ?>
<span class="current"><?php echo $paged ?></span>
<?php else: ?>
<a class="prev" href="?page=<?php echo ($current_page - 1) ?>">Prev</a>
<?php if ($current_page > 2): ?>
<a href="?page=1">1</a>
<?php endif ?>
<?php if ($current_page > 3): ?>
<span class="dots">...</span>
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@craigtp
craigtp / GetWindowsProductKey.vbs
Created May 30, 2016 18:10
Retrieve Windows Product Key
Option Explicit
Dim objshell,path,DigitalID, Result
Set objshell = CreateObject("WScript.Shell")
'Set registry key path
Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
'Registry key value
DigitalID = objshell.RegRead(Path & "DigitalProductId")
Dim ProductName,ProductID,ProductKey,ProductData
'Get ProductName, ProductID, ProductKey
@citrusui
citrusui / dropdown.md
Last active July 17, 2024 17:15
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
@DomPizzie
DomPizzie / README-Template.md
Last active July 22, 2024 11:29
A simple README.md template

Project Title

Simple overview of use/purpose.

Description

An in-depth paragraph about your project and overview of use.

Getting Started

/ *
* Gists provided for illustrative purposes only. Developers can use these as a support tool
* but the Office of the Revenue Commissioners (Revenue) does not provide any warranty with
* these gists.
*/
import java.util.Base64;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
@rponte
rponte / SignedXml.java
Last active February 2, 2024 11:35
How to sign a XML with private key certificate in Java (using Java Key Store)
package br.com.mdias.rponte.signature;
import java.util.Base64;
/**
* Represents a signed XML
*/
public class SignedXml {
private String content;

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active July 24, 2024 10:54
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user