Skip to content

Instantly share code, notes, and snippets.

Avatar

Simone Pessotto Pes8

View GitHub Profile
@djaiss
djaiss / progress_bar_migration_laravel.php
Last active October 13, 2022 15:12
Laravel: Use progress bars in migrations
View progress_bar_migration_laravel.php
<?php
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\ConsoleOutput;
class DoSomething extends Migration
{
public function up()
{
$output = new ConsoleOutput();
@jpatters
jpatters / HeidiDecode.js
Last active January 31, 2023 21:55
Decodes a password from HeidiSQL. HeidiSQL passwords can be found in the registry. Use File -> Export Settings to dump all settings. Great for if you forget a password.
View HeidiDecode.js
function heidiDecode(hex) {
var str = '';
var shift = parseInt(hex.substr(-1));
hex = hex.substr(0, hex.length - 1);
for (var i = 0; i < hex.length; i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
return str;
}
document.write(heidiDecode('755A5A585C3D8141786B3C385E3A393'));
@ikonst
ikonst / MountInfo.java
Created August 19, 2012 12:50
Java code to parse /proc/mounts.
View MountInfo.java
import java.io.*;
import java.nio.charset.Charset;
import java.util.*;
/**
* Parses of /proc/mounts.
*/
public class MountInfo {