Skip to content

Instantly share code, notes, and snippets.

View rosenpin's full-sized avatar

Tomer Rosenfeld rosenpin

View GitHub Profile
@rosenpin
rosenpin / close_notifications_applescript.js
Created January 7, 2023 18:46 — forked from lancethomps/close_notifications_applescript.js
AppleScript to close all notifications on macOS Big Sur
function run(input, parameters) {
const appNames = [];
const skipAppNames = [];
const verbose = true;
const scriptName = "close_notifications_applescript";
const CLEAR_ALL_ACTION = "Clear All";
const CLEAR_ALL_ACTION_TOP = "Clear";
@rosenpin
rosenpin / gist:bd424a76bd83a61edd6203a22038a5ca
Last active October 2, 2022 09:51 — forked from dlew/gist:debc5ea214678bf0739a8ec92dabe095
Privacy Policy for Apps That Collect No Data

Privacy Policy

This app collects no private data, period. Your data will not be used in any way, because we won't have it.

@rosenpin
rosenpin / agenda.15m.sh
Last active November 6, 2021 19:20
A wrapper script for i3-agenda used to show the output in SwiftBar.
#!/bin/bash
# <swiftbar.hideAbout>true</swiftbar.hideAbout>
# <swiftbar.hideRunInTerminal>true</swiftbar.hideRunInTerminal>
# <swiftbar.hideLastUpdated>true</swiftbar.hideLastUpdated>
# <swiftbar.hideDisablePlugin>true</swiftbar.hideDisablePlugin>
# max attempts count
max_attempts=5
# number of lines to interpret as error message
error_threshold=5
@rosenpin
rosenpin / DialogView.kt
Last active February 12, 2021 16:27
bottom sheet alert dialog
class DialogView : BottomSheetDialogFragment() {
private lateinit var binder: DialogViewBinding
private var icon: Drawable? = null
private var negativeText: String? = null
private var negativeListener: Listener? = null
private lateinit var title: String
private var content: String? = null
private var positiveText: String? = null
private var positiveListener: Listener? = null
-- Journal begins at Thu 2020-10-01 09:22:33 IDT, ends at Sun 2021-02-07 00:17:01 IST. --
Feb 06 23:46:25 pc kernel: microcode: microcode updated early to revision 0x28, date = 2019-11-12
Feb 06 23:46:25 pc kernel: Linux version 5.10.8-arch1-1 (linux@archlinux) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Sun, 17 Jan 2021 22:07:13 +0000
Feb 06 23:46:25 pc kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=13901346-db55-4d41-9e34-f93ab07299f1 rw resume=UUID=04cdd304-1324-448f-a52b-e40e5d2db744 intel_iommu=on iommu=pt vfio-pci.ids=10de:13c2,10de:0fbb
Feb 06 23:46:25 pc kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
Feb 06 23:46:25 pc kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
Feb 06 23:46:25 pc kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
Feb 06 23:46:25 pc kernel: x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
Feb 06 23:46:25 pc kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 byte
@rosenpin
rosenpin / protonmail-delete-all-in-folder.js
Created August 11, 2018 13:39
Delete all emails in an open folder in Protonmail
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function deleteAllMails(){
for (var i = 0;i<100;i++){
setTimeout(function(){document.getElementById("selectAll").click()},1000);
setTimeout(function(){document.getElementsByClassName("moveElement-btn-delete")[0].click()},3000);
setTimeout(function(){document.getElementById("confirmModalBtn").click()},5000);
await sleep(10000)
@rosenpin
rosenpin / WhatsappStalker.js
Last active August 11, 2018 13:38
Get an array representing the hours a person is active on Whatsapp. Saved to local Storage and viewable by using 'console.log(hoursArray)'
var LOCAL_STORAGE_KEY = "activelogintimestatistics"
var lastSeenTime
var localStorageData = localStorage[LOCAL_STORAGE_KEY]
var localStorageArray = localStorageData != undefined ? JSON.parse(localStorageData) : undefined
var hoursArray = (localStorageArray == undefined) ? [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] : localStorageArray
console.log(hoursArray)
update = function() {
var textSpan = document.getElementsByClassName("emojitext O90ur")[0]
if (textSpan == null) {
console.log("An error has occured, couldn't find the last seen label")
@rosenpin
rosenpin / youtube full window.user.js
Last active July 24, 2017 15:15
Make Youtube videos full window instead of full screen, requires greasemonkey
// ==UserScript==
// @version 1.1
// @name Make Youtube videos full window instead of full screen
// @match *://www.youtube.com/*
// @run-at document-end
// @grant none
// @noframes
// ==/UserScript==
function updatePage(){
var l = window.location.href;
@rosenpin
rosenpin / TelegramMathBattleBot.js
Last active July 20, 2017 19:41
Math Battle Bot For Telegram
var index = 0
var reps = 77
function run(){
if(index < reps){
setTimeout(function(){
var operator = {"+" : "+", "–" : "-", "×" : "*", "/" : "/"}[document.getElementById("task_op").innerText]
var x = document.getElementById("task_x").innerText
var y = document.getElementById("task_y").innerText
var solution = document.getElementById("task_res").innerText
var w_button = document.getElementById("button_wrong")
@rosenpin
rosenpin / ImgesGetter.js
Created April 23, 2017 14:58
bota.to Downloader - Botato manga/comics downloader
//Run this in the console in your browser while having the manga you would like to download open
function readAndNext(){
setTimeout(function(){
console.log(document.getElementById("comic_page").src.substr(0, document.getElementById("comic_page").src.indexOf("/img00")))
document.querySelectorAll('[title="Next Chapter"]')[0].click()
readAndNext()
},3000)
}