Instantly share code, notes, and snippets.
Discover gists
jeffjohnson9046 /git-ignore.sh
CreatedAugust 11, 2015 21:02
Remove unwanted files from a git repo AFTER adding a .gitignore. The files will remain on disk. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
## I just ran into this after initializing a Visual Studio project _before_ adding a .gitignore file (like an idiot). | |
## I felt real dumb commiting a bunch of files I didn't need to, so the commands below should do the trick. The first two commands | |
## came from the second answer on this post: http://stackoverflow.com/questions/7527982/applying-gitignore-to-committed-files | |
# See the unwanted files: | |
git ls-files -ci --exclude-standard | |
# Remove the unwanted files: | |
git ls-files -ci --exclude-standard -z| xargs -0 git rm --cached |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
importchalkfrom"chalk" | |
import{entityKind,typeLogger}from"drizzle-orm" | |
import{formatasformatSql}from"sql-formatter" | |
chalk.level=3 | |
functiongetSqlColor(sql:string){ | |
constnormalized=sql.trim().toUpperCase() | |
if(normalized.startsWith("INSERT"))return"green" | |
if(normalized.startsWith("DELETE"))return"red" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
<?php | |
/** @noinspection ? */ | |
// PhpUndefinedGotoLabelInspection Undefined goto label | |
// PhpUndefinedVariableInspection Undefined variable | |
// PhpUndefinedMethodInspection Undefined method | |
// PhpUndefinedNamespaceInspection Undefined namespace | |
// PhpUndefinedClassInspection Undefined class | |
// PhpUndefinedFunctionInspection Undefined function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
// Pin definitions | |
#defineDATA_PIN2 | |
#defineCLOCK_PIN3 | |
#defineHI(pin) pinMode(pin, INPUT) | |
#defineLO(pin) pinMode(pin, OUTPUT) | |
enum VOLTAGE:uint32_t { | |
_12vto15v =0b11, | |
_9vto12v =0b10, | |
_6vto9v =0b01, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
KEYMAPOPTS="us us" | |
HOSTNAMEOPTS="-n alpine" | |
INTERFACESOPTS="auto lo | |
iface lo inet loopback | |
auto eth0 | |
iface eth0 inet dhcp | |
hostname alpine | |
" | |
TIMEZONEOPTS="-z UTC" |
Find the Discord channel in which you would like to send commits and other updates
In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe!
lluis /Debian13_Slimbook_Creative_laptop.md
CreatedJuly 6, 2025 07:47
Debian 13 on Slimbook Creative Laptoppeterjaap /varnish6-xkey.vcl
Last activeJuly 12, 2025 20:54
Optimized Varnish VCL for Magento 2. See the non-Xkey version here:https://gist.github.com/peterjaap/006169c5d95eeffde3a1cc062de1b514 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
# Optimized VCL for Magento 2 | |
vcl4.1; | |
import std; | |
import cookie; | |
import xkey; | |
# The minimal Varnish version is 6.0 | |
# For SSL offloading, pass the following header in your proxy server or load balancer: '/* {{ ssl_offloaded_header }} */: https' |
NewerOlder