Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Working full time. I may be slow to respond.

Tomer Rosenfeld rosenpin

💭
Working full time. I may be slow to respond.
View GitHub Profile
@rosenpin
rosenpin / DialogView.kt
Last active Feb 12, 2021
bottom sheet alert dialog
View DialogView.kt
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
View gist:43408dda08202d4e0c7ed659ee297b9c
-- 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 Aug 11, 2018
Delete all emails in an open folder in Protonmail
View protonmail-delete-all-in-folder.js
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 Aug 11, 2018
Get an array representing the hours a person is active on Whatsapp. Saved to local Storage and viewable by using 'console.log(hoursArray)'
View WhatsappStalker.js
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 Jul 24, 2017
Make Youtube videos full window instead of full screen, requires greasemonkey
View youtube full window.user.js
// ==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 Jul 20, 2017
Math Battle Bot For Telegram
View TelegramMathBattleBot.js
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 Apr 23, 2017
bota.to Downloader - Botato manga/comics downloader
View ImgesGetter.js
//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)
}
@rosenpin
rosenpin / Android Music Players Package Names
Created Jan 15, 2017
An array of as many music players package names as I could find, feel free to contribute
View Android Music Players Package Names
final String[] musicAppsPackageNames = {
"com.spotify.music",
"com.google.android.music",
"com.apple.android.music",
"com.Project100Pi.themusicplayer",
"media.audioplayer.musicplayer",
"com.musicplayer.player.mp3player.white",
"com.sec.android.app.music",
"com.zentertain.music.player",
"com.kodarkooperativet.blackplayerfree",
@rosenpin
rosenpin / AS-generate-signed.sh
Created Sep 29, 2016
generate signed apk with xdotool
View AS-generate-signed.sh
xdotool keydown alt && xdotool keydown b && xdotool keyup alt && xdotool keyup b && xdotool keydown 111 && xdotool keyup 111 && xdotool keydown 111 && xdotool keyup 111 && xdotool keydown 111 && xdotool keyup 111 && xdotool keydown 36 && xdotool keyup 36
@rosenpin
rosenpin / pokemon-list.java
Created Jul 22, 2016
List of all the gen 1 Pokemon in java
View pokemon-list.java
String[] pokemon = {
"BULBASAUR", "IVYSAUR", "VENUSAUR", "CHARMANDER", "CHARMELEON", "CHARIZARD", "SQUIRTLE", "WARTORTLE", "BLASTOISE", "CATERPIE", "METAPOD", "BUTTERFREE", "WEEDLE", "KAKUNA", "BEEDRILL", "PIDGEY", "PIDGEOTTO", "PIDGEOT", "RATTATA", "RATICATE", "SPEAROW", "FEAROW", "EKANS", "ARBOK", "PIKACHU", "RAICHU", "SANDSHREW", "SANDSLASH", "NIDORAN", "NIDORINA", "NIDOQUEEN", "NIDORAN", "NIDORINO", "NIDOKING", "CLEFAIRY", "CLEFABLE", "VULPIX", "NINETALES", "JIGGLYPUFF", "WIGGLYTUFF", "ZUBAT", "GOLBAT", "ODDISH", "GLOOM", "VILEPLUME", "PARAS", "PARASECT", "VENONAT", "VENOMOTH", "DIGLETT", "DUGTRIO", "MEOWTH", "PERSIAN", "PSYDUCK", "GOLDUCK", "MANKEY", "PRIMEAPE", "GROWLITHE", "ARCANINE", "POLIWAG", "POLIWHIRL", "POLIWRATH", "ABRA", "KADABRA", "ALAKAZAM", "MACHOP", "MACHOKE", "MACHAMP", "BELLSPROUT", "WEEPINBELL", "VICTREEBEL", "TENTACOOL", "TENTACRUEL", "GEODUDE", "GRAVELER", "GOLEM", "PONYTA", "RAPIDASH", "SLOWPOKE", "SLOWBRO", "MAGNEMITE", "MAGNETON", "FARFETCHD", "DODUO", "DODRIO", "SEEL",