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
# Nuclear restart of SSHD and all connections | |
$sshConnections = Get-NetTCPConnection -LocalPort 22 -State Established -ErrorAction SilentlyContinue | |
Stop-Service sshd | |
foreach ($conn in $sshConnections) { | |
$process = Get-Process -Id $conn.OwningProcess -ErrorAction SilentlyContinue | |
if ($process) { | |
Stop-Process -Id $process.Id -Force | |
} |
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
const fullTextRaw = $json["body"]["text"] || ""; | |
const fullText = fullTextRaw.trim(); // remove leading/trailing whitespace | |
const lines = fullText.split('\n').map(line => line.trim()); | |
// Look for lines | |
const summaryLine = lines.find(line => line.includes("Cloudflare Pages:")); | |
const commitLine = lines.find(line => line.startsWith("Commit Hash:")); | |
const envLine = lines.find(line => line.startsWith("Environment:")); | |
// If any line is missing, exit the workflow |
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
function Compare-XmlContent { | |
param ( | |
[Parameter(Mandatory=$true)] | |
[string]$FirstXml, | |
[Parameter(Mandatory=$true)] | |
[string]$SecondXml, | |
[Parameter(Mandatory=$false)] | |
[switch]$IgnoreWhitespace, |
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
import { Controller } from "@hotwired/stimulus" | |
export default class extends Controller { | |
static targets = [ "canvas" ] | |
static values = { | |
numberOfRows: Number, | |
labels: Array, | |
data: Array | |
} |
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
chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) { | |
if (message.action === "googleMeetBringToFront") { | |
chrome.tabs.query({}, function (tabs) { | |
let meetFound = false; | |
for (let i = 0; i < tabs.length; i++) { | |
if (tabs[i].url.includes('meet.google.com')) { | |
meetFound = true; | |
chrome.tabs.update(tabs[i].id, { selected: true }); | |
chrome.windows.update(tabs[i].windowId, { focused: true }); |
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
npm uninstall tailwindcss postcss autoprefixer | |
npm install tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9 |
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
# brew install tmuxp | |
# tmuxp load tmuxp.yaml | |
session_name: laravel-app | |
windows: | |
- window_name: laravel-app | |
layout: tiled | |
panes: | |
- docker-compose -f docker-compose.yml up | |
- php artisan serve | |
- npm run dev |
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
/** | |
* Laravel's Sanctum is not great at validating bearer tokens. | |
* If you want to validate a token for more than "does it exist", you need to do it manually. | |
* Here's an example inside an controller: | |
*/ | |
class ApiSearchController extends Controller | |
{ | |
public function store(Request $request) | |
{ |
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
import asyncio | |
from Smile import Smile | |
import json | |
async def main(): | |
smile = Smile("192.168.0.0", "password") | |
await smile.connect() | |
await smile.update_locations() | |
# Get the current power consumption in watts |
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
/* global $CC, Utils, $SD */ | |
/* THIRD PARTY */ | |
// https://github.com/joewalnes/reconnecting-websocket/blob/master/reconnecting-websocket.js | |
(function(global, factory) { | |
if (typeof define === 'function' && define.amd) { | |
define([], factory); | |
} else if (typeof module !== 'undefined' && module.exports) { | |
module.exports = factory(); | |
} else { |
NewerOlder