Skip to content

Instantly share code, notes, and snippets.

View mbolli's full-sized avatar

Michael Bolli mbolli

View GitHub Profile
@stevegrunwell
stevegrunwell / get_current_git_commit.php
Created August 15, 2012 21:44
Get current git HEAD using PHP
<?php
/**
* Get the hash of the current git HEAD
* @param str $branch The git branch to check
* @return mixed Either the hash or a boolean false
*/
function get_current_git_commit( $branch='master' ) {
if ( $hash = file_get_contents( sprintf( '.git/refs/heads/%s', $branch ) ) ) {
return $hash;
} else {
@GaryRogers
GaryRogers / createPhar.php
Last active March 28, 2020 23:54
Create a Phar archive for PHP
<?php
# Create an executable phar
# Name of our archive.
$phar = new Phar("myscript.phar");
# Have to do buffering to make things executable.
# See http://stackoverflow.com/questions/11082337/how-to-make-an-executable-phar
$phar->startBuffering();
@HELWATANY
HELWATANY / Webstorm64.vmoptions
Last active July 9, 2025 00:34
[Updated 2025] JetBrains Custom VM Options Configuration Optimized For High Performance... Works with all JetBrains IDEs... JDK 8.x+ Recommended....
# Make sure to modify "-Xms", "Xmx", "CICompilerCount", and "ParallelGCThreads" according to your PC hardware configuration...
# -------------------------------------------
# Memory Settings (High-Memory Workstation)
# -------------------------------------------
# Set the initial heap size (this reduces resizing overhead)
-Xms2048m
# Set the maximum heap size (adjust depending on your system; 2048m or 4096m is good for modern machines)