Skip to content

Instantly share code, notes, and snippets.

View Splode's full-sized avatar

Christopher Murphy Splode

View GitHub Profile
@Splode
Splode / electron-reset.css
Last active December 20, 2023 03:12
Disable selection/highlighting and element draggin in Electron
/* disable selection */
:not(input):not(textarea),
:not(input):not(textarea)::after,
:not(input):not(textarea)::before {
-webkit-user-select: none;
user-select: none;
cursor: default;
}
input, button, textarea, :focus {
outline: none;
@Splode
Splode / Laravel-Scheduler-Windows.md
Last active September 19, 2024 17:37
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.
@Splode
Splode / fullscreen.bat
Created April 17, 2019 17:59
Start Brave/Chrome in fullscreen mode
"C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\Brave.exe" --start-fullscreen http://localhost
@Splode
Splode / backup.bat
Created March 28, 2019 22:15
Recursively copy directory on Windows and log output to file
cd C:\Users\MT_User\scripts
IF NOT EXIST .\logs mkdir .\logs
robocopy C:\Users\MT_User\scripts\test C:\Users\MT_User\scripts\backup /s >> .\logs\%date%.log
@Splode
Splode / perm.sh
Created June 5, 2018 19:15
Allow Laravel `php artisan` permissions on Ubuntu
sudo chgrp -R www-data storage
sudo chgrp -R www-data bootstrap/cache
sudo chmod -R ug+rwx storage
sudo chmod -R ug+rwx bootstrap/cache
@Splode
Splode / iterate.js
Created December 18, 2017 16:34
Iterate over the array-like object, HTMLCollection using Array.prototype
// HTML Collection
const articles = document.querySelectorAll('.article')
// Iterate using Array.prototype
Array.prototype.forEach.call(articles, el => {
// iterate over el
}
@Splode
Splode / index.html
Created December 4, 2017 17:23
Intrinsic Image Placholders
<div class="Intrinsic-wrapper">
<img class="Intrinsic-item Intrinsic-item--1x1" src="">
</div>
<style>
.Intrinsic-wrapper {
display: block;
padding-top: 100%;
position: relative;
width: 100%;
@Splode
Splode / preload-img.js
Last active November 20, 2017 17:24
Pre-load images for faster painting of new images
// example imgObj
const img = {
filename: 'example.jpg',
caption: 'example-caption'
}
function preloadImgs (imageLs) {
imageLs.forEach(imgObj => {
let img = new Image()
img.src = imgObj.filename
@Splode
Splode / node-cli-commands.md
Created September 29, 2017 02:48
A list of useful commands for running Node

Run a Process in the Background

  1. When a process is running, press ctrl+z to step out of the current process and show running processes.
  2. To continue running a process in the background, use the following command: bg %1, where the %1 is the index of the process.

List Running Processes and Filter by Name

ps -ef | grep node

Kill a Process by Name

@Splode
Splode / .gitignore
Created August 9, 2017 22:48
Gitignore Template
# ================ Windows =====================
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump