Skip to content

Instantly share code, notes, and snippets.

View CoolGoose's full-sized avatar
🐕
Manners Maketh Man

Alexandru Bucur CoolGoose

🐕
Manners Maketh Man
View GitHub Profile
<?php
namespace Grav\Plugin\Console;
use Grav\Console\ConsoleCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
/**
* Class GeneratorCommand
*
@CoolGoose
CoolGoose / generate_month_diff.php
Last active February 28, 2017 15:37
Get an array of months between two dates in PHP for table based reports :)
<?php
generateTableMappings($raw_start_date, $raw_end_date)
{
$start_date = \Datetime::createFromFormat('Y-m', $raw_start_date);
$end_date = \Datetime::createFromFormat('Y-m', $raw_end_date);
$iteration_date = clone $start_date;
$tables = [];
while ($iteration_date <= $end_date) {
@CoolGoose
CoolGoose / cleanup_phone_photos.ps
Last active June 8, 2023 18:37
Move your camera roll pictures in folders, i've liked year / year-month with month having leading 0 (originally at https://www.thomasmaurer.ch/2015/03/move-files-to-folder-sorted-by-year-and-month-with-powershell/)
$TagLib = "C:\Program Files\PackageManagement\NuGet\Packages\TagLibSharp.2.2.0\lib\netstandard2.0\TagLibSharp.dll"
Add-Type -Path $TagLib
[System.Reflection.Assembly]::LoadFile($TagLib)
# Get the files which should be moved, without folders
$files = Get-ChildItem 'X:\Tmp\moveit' -Recurse | Where-Object { !$_.PSIsContainer }
# List Files which will be moved
$files
@CoolGoose
CoolGoose / ApiResponseHelper.cs
Created May 1, 2018 16:17
Simple JSON API ASP .NET Core Error handling class
using Newtonsoft.Json.Linq;
using System.Linq;
using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace Craidd.Helpers
{
/// <summary>
/// Manage JSON Api response
/// </summary>
public class ApiResponseHelper : IApiResponseHelper
@CoolGoose
CoolGoose / webpack.config.js
Created September 23, 2018 15:35
mini css extract scss issue
const path = require("path");
const merge = require("webpack-merge");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const WebpackBarPlugin = require("webpackbar");
const outputFolder = path.resolve(__dirname, "../public_html/assets");
@CoolGoose
CoolGoose / style.sh
Created May 3, 2023 19:37
Simple chroma based css preferred color scheme generator
#!/usr/bin/env bash
set -euo pipefail
# Default values
light_theme=""
dark_theme=""
destination_path="assets/css/extended/syntax.css"
# Help message
usage() {