Skip to content

Instantly share code, notes, and snippets.

View beinoriusju's full-sized avatar
🏠
Working from home

Justinas Bei beinoriusju

🏠
Working from home
View GitHub Profile
@beinoriusju
beinoriusju / protonmail_read_all_browser_script.js
Created February 9, 2022 07:19
Protonmaill Read All Solution
/*
Protonmail does not allow to "mark all email as read". You can only do this page by page (50 at a time), but when you have thousands manualy going through each page is not possible. Here is my solution.
1. Open "All email" folder
2. Select "Unread"
3. Open browser developer tools (F12)
4. Paste this script.
5. If it does not work ask a friend developer to help you.
*/
@beinoriusju
beinoriusju / pocketbook3-quote-upload.py
Created December 31, 2020 07:01
Python PocketBook 3 quote script
# 1. Scan devices and let me choose
# 2. Scan books and let me choose or ALL
# 3. Store quotes in fille /quotes/BookName-DATE.odt append bookmarked page numbers at the end (v1)
import sqlite3, os, json, re
from ezodf2 import newdoc, opendoc, Paragraph, Heading, Sheet
from datetime import date
from operator import itemgetter
import random
@beinoriusju
beinoriusju / google_play_linked_data_Example.json
Created December 5, 2019 07:05
Google Play application/ld+json
{
"@context": "https://schema.org",
"@type": "Book",
"name": "The Unhoneymooners",
"url": "https://play.google.com/store/books/details/The_Unhoneymooners?id\\u003d3kaBDwAAQBAJ\\u0026hl\\u003den_US",
"workExample": {
"@type": "Book",
"bookFormat": "https://schema.org/EBook",
"abridged": "https://schema.org/False",
"isbn": "9781501128035",
<?php
class ControllerExtensionModuleAgeRestriction extends Controller {
public function index($setting = null) {
$data = array();
return $this->load->view('extension/module/age_restriction', $data);
}
}
<?php
class ControllerExtensionModuleAgeRestriction extends Controller {
public function index($setting = null) {
$this->load->language('extension/module/age_restriction');
if ($setting && $setting['status']) {
$show_modal = false;
$data = array();
<!-- Modal -->
<div id="age-restriction-modal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{modal_title}}</h4>
</div>
<div class="modal-body">
<p>{{message}}</p>
<?php
class ControllerExtensionModuleAgeRestriction extends Controller {
public function index($setting = null) {
if ($setting && $setting['status']) {
$data = array();
$data['message'] = sprintf($setting['message'], $setting['age']);
$data['age'] = $setting['age'];
var AGE_RESTRICTION_SESSION_KEY = '{{session_redirect}}';
window.addEventListener('load', function(){
$(document.getElementById('age-restriction-modal')).modal({backdrop: "static"});
document.getElementById('age-negative').addEventListener('click', function(){
window.location = "{{redirect_url}}";
});
<?php
class ControllerExtensionModuleAgeRestriction extends Controller {
public function index($setting = null) {
$this->load->language('extension/module/age_restriction');
if ($setting && $setting['status']) {
$show_modal = false;
$data = array();
<?php
class ControllerExtensionModuleAgeRestriction extends Controller {
const DEFAULT_MODULE_SETTINGS = [
'name' => 'Age Restriction (21)',
'message' => 'Are you %s and older?',
'age' => 21,
'redirect_url' => 'http://www.example.org',
'status' => 1 /* Enabled by default*/
];