Skip to content

Instantly share code, notes, and snippets.

View eritislami's full-sized avatar

Erit Islami eritislami

View GitHub Profile
<?php
namespace App\Charts;
use App\Support\Livewire\ChartComponentData;
use ConsoleTVs\Charts\Classes\Chartjs\Chart;
/**
* Class WanSpeedTestsChart
*
@onlurking
onlurking / programming-as-theory-building.md
Last active July 22, 2024 13:14
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@hungneox
hungneox / laravel_tranlations_to_json.php
Last active December 8, 2022 11:44
Laravel translation to Json
<?
# 1
foreach (glob(resource_path() . '/lang/*/*.php') as $file) {
preg_match('#^.*/([A-z]*)/([A-z]*).php$#', $file, $matches);
$trans[$matches[1]][$matches[2]] = require($file);
}
foreach ($trans as $lang => $translations) {
$fileContents = sprintf('var trans = %s;', json_encode($translations));
file_put_contents(public_path() . '/js/trans.' . $lang . '.js', $fileContents);
@xPaw
xPaw / README.md
Last active July 15, 2024 09:09
Counter-Strike local server practice config
@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 {