Skip to content

Instantly share code, notes, and snippets.

@Splode
Splode / Laravel-Scheduler-Windows.md
Last active May 21, 2024 02:33
Laravel Scheduler on Windows

Run Laravel Scheduled Tasks on Windows

The following are instructions for running scheduled tasks defined in a Laravel project on Windows. The Laravel documentation provides instructions for running scheduled tasks using cron jobs on Linux systems. However, cron jobs are not available on Windows. The built-in Windows Task Scheduler can be used to run scheduled tasks instead.

Create a Scheduled Task

  1. Open Task Scheduler
  2. Select Create Task...
  3. Give the task a name and description
  4. To run the task in the background, select Run whether the user is logged on or not and check the Hidden checkbox.
import FirebaseFirestore
private struct Property {
let label: String
let value: Any
}
struct FirestoreModelData {
let snapshot: DocumentSnapshot
@robinloeffel
robinloeffel / _grid-ie-calc.scss
Last active January 15, 2020 22:36
Dynamic CSS Grid Items in Internet Explorer and Edge - https://grid-ie-calc.surge.sh
/*
This mixin allows us use CSS grid without having to think about
what -ms-grid-row/-ms-grid-column we have to assign to a grid element
for it to properly work on Internet Explorer and Edge.
It takes three arguments, the last one of which is optional. Specify the
maximum amount of items you want to have in your grid, when they should
break to the next line and, if you like, a grid-gap of some sort.
@stevegrunwell
stevegrunwell / one-time-hooks.php
Created February 14, 2017 20:06
Enables action and filter callbacks to be executed exactly once via the WordPress Plugin API. https://engineering.growella.com/one-time-callbacks-wordpress-plugin-api/
<?php
/**
* Registers the "One time hook" functionality.
*
* Note that this file is intentionally in the *global* namespace!
*
* @author Growella
* @license MIT
*/
@azizur
azizur / Creating a static copy of a dynamic website.md
Last active May 25, 2024 16:06
Creating a static copy of a dynamic website

The command line, in short…

wget -k -K -E -r -l 10 -p -N -F --restrict-file-names=windows -nH http://website.com/

…and the options explained

  • -k : convert links to relative
  • -K : keep an original versions of files without the conversions made by wget
  • -E : rename html files to .html (if they don’t already have an htm(l) extension)
  • -r : recursive… of course we want to make a recursive copy
  • -l 10 : the maximum level of recursion. if you have a really big website you may need to put a higher number, but 10 levels should be enough.
@mcguffin
mcguffin / acf-get-field-key.php
Last active June 13, 2023 13:32
WordPress Advanced Custom Fields get field key from field name
<?php
/**
* Get field key for field name.
* Will return first matched acf field key for a give field name.
*
* ACF somehow requires a field key, where a sane developer would prefer a human readable field name.
* http://www.advancedcustomfields.com/resources/update_field/#field_key-vs%20field_name
*
* This function will return the field_key of a certain field.