Skip to content

Instantly share code, notes, and snippets.

View trimechee's full-sized avatar
💯

trimechee

💯
View GitHub Profile
alias: 'Bedroom auto turn on High Power Lights '
description: ''
trigger:
- platform: numeric_state
entity_id: switch.adaptive_lighting_bedroom
attribute: color_temp_kelvin
for: '00:05:00'
above: '5000'
- platform: state
entity_id: input_boolean.bedroom_lights_master_switch
@luckyshot
luckyshot / bookmarklets.md
Created February 26, 2021 19:03
Bookmarklets: Useful miscelaneous

CaixaBank

Get total fluctuation to paste in Excel:

let total = '';
document.querySelectorAll('.color--gray500.font--size-90.white_space--nowrap').forEach(function(item){total += "\n" + item.innerHTML.replace('+ ', '').replace('.','').replace(',','.');});
console.log(total)
@Aldaviva
Aldaviva / Windows 10 & 11 services.md
Last active June 24, 2025 12:45
Safety of disabling services in Windows 10 and 11

These settings apply to normal, functioning Windows 10 and 11 Pro desktops and laptops with

  • wired Ethernet
  • Wi-Fi
  • Bluetooth
  • IPv4
  • IPv6
  • no touch screen

Safe to disable

@luckyshot
luckyshot / download.js
Created September 18, 2020 13:28
Download all images from website (JS + PHP)
var buffer = [];
document.querySelectorAll('img').forEach(function(item) {
if (item.src){
buffer.push( item.src );
}
});
console.log('Total items:', buffer.length );
localStorage.buffer = JSON.stringify(buffer);
// Now grab localStorage.buffer and paste it in PHP
@valinet
valinet / README.md
Last active April 15, 2025 14:05
Get dark command windows all the time in Windows

Case study: Get dark command windows all the time in Windows

TL;DR

  1. Make a copy conhost.exe from System32.
  2. Open it with a hex editor (I use HxD).
  3. In HxD, go to Search - Find - Hex-values.
  4. Search for 881d9e530a004885c07477ff15b32e08009084c0.
  5. In Windows 10 version 2004, replace ff15b32e0800 with 909090909090. If using Windows 10 version 20H2, replace ff15b32e08009084 with 9090909090909090.
  6. Save file and copy it back to System32 (take ownership of original conhost.exe in order to replace it).
  7. Profit!
@panzi
panzi / VideoScreenshot.js
Last active May 7, 2022 10:59
Make a screenshot of a video.
javascript:(function() {
function screenshot(video) {
var canvas = document.createElement('canvas');
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
context = canvas.getContext('2d');
var now = new Date();
context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
var url = canvas.toDataURL('image/png');
var link = document.createElement('a');
@panzi
panzi / enable_context_menu.js
Created July 22, 2020 21:17
Bookmarklet to re-enable context menus on sites that disable it.
javascript:(function(pd){Event.prototype.preventDefault=function(){if(this.type!=='contextmenu')return%20pd.apply(this,arguments);};})(Event.prototype.preventDefault);void(0)
@eliorsterling
eliorsterling / readingmode.js
Created June 19, 2020 01:03 — forked from luckyshot/readingmode.js
Bookmarklet: Readability (remove all styling from a website, optimize for reading and scroll to article). Also available as a Chrome Extension: https://chrome.google.com/webstore/detail/readingmode-lightest/peoapnglceoafojobbkpohnojniabmkd
javascript:
/*! ReadingMode © Xavi Esteve */
(function(d) {
var el = d.getElementsByTagName("*");
var htmlDiv = d.createElement("div");
var readingModeMenu = d.createElement("div");
var title = d.title;
var rmSettings = {};
/* Remove all event listeners */
@luckyshot
luckyshot / magic-copy.js
Last active December 11, 2023 21:00
JavaScript - Add/Append custom text on copy to clipboard
/**
* Magic Copy
* This little script will append some text to the clipboard when a user copies text from the website
*
* WARNING: This feature is an anti-pattern and a bad usability practice in 99% of cases, use only in
* those situations where it can really benefit the user to have a link to the full resource
*/
document.addEventListener('copy', (event) => {
if (document.getSelection().toString().length < 10){ return; }
const pagelink = `\n${document.location.href}`;
@RubenKelevra
RubenKelevra / IPFS-convert-datastore-with-system-service-installation.md
Created May 4, 2020 18:50
IPFS convert datastore with system service installation

Compile the tool https://github.com/ipfs/ipfs-ds-convert via your user account

echo "$GOPATH" -> if empty go to ~/go/bin/, else "$GOPATH/bin/"

copy the ipfs-ds-convert binary to /tmp/:

cp -a ipfs-ds-convert /tmp/

convert your datastore: