Skip to content

Instantly share code, notes, and snippets.

View Pes8's full-sized avatar

Simone Pessotto Pes8

View GitHub Profile
@djaiss
djaiss / progress_bar_migration_laravel.php
Last active January 24, 2024 13:40
Laravel: Use progress bars in migrations
<?php
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\ConsoleOutput;
class DoSomething extends Migration
{
public function up()
{
$output = new ConsoleOutput();
@janpipek
janpipek / input-storage.js
Created June 19, 2013 09:56
Auto-store state of input elements in localStorage (jQuery)
/**
* Simple jQuery utility for saving element values in localStorage.
*
* Usage:
* - Add class "store-state" to the element you want to save.
* - Add id attribute to the element or specify your own storage key (attribute data-storage-name)
* - Add attribute "data-storage-name" to the element if you
* want to control under which name the value will be stored
* - Add attribute "data-storage-noload" to suppress loading (will be stored though, it is
* useful, when HTML-specified value is temporarily more important).
@jpatters
jpatters / HeidiDecode.js
Last active March 20, 2024 14:29
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.
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.
import java.io.*;
import java.nio.charset.Charset;
import java.util.*;
/**
* Parses of /proc/mounts.
*/
public class MountInfo {