Skip to content

Instantly share code, notes, and snippets.

View lucahammer's full-sized avatar
💭
Cleaning code.

Luca Hammer lucahammer

💭
Cleaning code.
View GitHub Profile
@lucahammer
lucahammer / docker-compose.yml
Created February 29, 2024 10:31
Snipe IT docker compose behind NGINX Proxy with HTTPS
version: '3'
services:
snipeit:
image: snipe/snipe-it:latest
container_name: snipeit
ports:
- "44100:443"
volumes:
- ./storage/logs:/var/www/html/storage/logs
// ==UserScript==
// @name TweetXer
// @namespace https://gist.github.com/lucahammer/a4d1e957ec9e061e3cccafcbed599e16/
// @version 0.5
// @description Delete all your Tweets for free.
// @author Luca
// @match https://twitter.com/*
// @icon https://www.google.com/s2/favicons?domain=twitter.com
// @grant unsafeWindow
// ==/UserScript==
(function (obj, method) {
obj[method] = (function (obj_method) {
return function (child) {
if (child.getAttribute("data-testid") == "tweet") return child;
return obj_method.apply(this, arguments);
};
})(obj[method]);
})(Element.prototype, "removeChild");
@lucahammer
lucahammer / delete-tweets.js
Last active February 17, 2024 00:45
Delete all your Tweets Javascript
/*
This may get your account banned. It runs in your regular browser with your regular login without needing the API.
The script does the same things that you would do yourself:
Click the three dots, select delete Tweet, confirm, scroll to next Tweet, repeat.
==========================
Usage
1. Open your Twitter profile in a browser
2. Open the console in the developer tools (F12)
3. Paste the script and press enter
4. ???
@lucahammer
lucahammer / ble2mqtt4ha.py
Created August 20, 2023 14:39
Example of capturing data from a Xiaomi Mijia MCCGQ02HL Window/Door Sensor 2 and sending it via MQTT to Home Assistant.
# https://github.com/Ernst79/bleparser
# https://gist.github.com/freol35241/48ca1d5e388b6892990dfd7fd6b3d2a2
# Adapted by https://social.luca.run/@luca
# MIT License
# Copyright (c) 2021 freol35241
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@lucahammer
lucahammer / bookmarklet_faster.js
Created June 17, 2022 08:42
Save the code as a firefox bookmark to speed up and video or audio file on any website
javascript:(function(){[].forEach.call(document.querySelectorAll('video,audio'), media => media.playbackRate += 0.5);console.log('playback speed: '+document.querySelectorAll('video,audio')[0].playbackRate);})();
// slower:
// javascript:(function(){[].forEach.call(document.querySelectorAll('video,audio'), media => media.playbackRate -= 0.5);console.log('playback speed: '+document.querySelectorAll('video,audio')[0].playbackRate);})();
'''
MIT License
Copyright (c) 2022 Luca Hammer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@lucahammer
lucahammer / voteswiper-to-gdf.py
Last active August 21, 2021 12:11
Python script to create a Gephi network from voteswiper.org data
'''
Copyright 2021 Luca Hammer
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
@lucahammer
lucahammer / tweets-jsonl-to-co-hashtag-gexf.py
Last active October 13, 2021 11:50
DMI Summerschool Deepfakes Co-Hashtag Network
'''
Copyright 2021 Luca Hammer
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
@lucahammer
lucahammer / readme.txt
Created October 12, 2020 14:18
Readme of Twitter data export 2020-10-12
INTRODUCTION
============
This archive was generated at the request of the following user:
- @username at the time the archive was generated: luca
- Account ID: 11985982
The easiest way to navigate your archive is to open the HTML renderer in a desktop web browser by double clicking the “Your archive” file included in the main folder once the archive is unzipped.
Note that the HTML renderer only works if the archive is less than 50GB. Also note that the HTML renderer only includes a subset of the data included in the archive. To see all the data included in the archive, please navigate the JSON files located in the “data” folder.