Skip to content

Instantly share code, notes, and snippets.

View merqurio's full-sized avatar

Gabi Maeztu merqurio

View GitHub Profile
@Rochdy
Rochdy / autoScroll.js
Created February 18, 2023 03:04
Auto scroll youtube shorts
const observer = new MutationObserver(
(mutationList, observer) => {
for (const mutation of mutationList) {
if (mutation.type === 'attributes' && mutation.target.localName === 'video') {
//Change the video playback speed if you think people are boring
//mutation.target.playbackRate = 1.25;
mutation.target.loop = false;
mutation.target.onended = (e) => document.getElementById('shorts-container').scrollTop += mutation.target.scrollHeight;
}
}
@merqurio
merqurio / psql_useful_stat_queries.sql
Created March 12, 2020 09:32 — forked from anvk/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@naile
naile / search.js
Created February 3, 2019 20:55
search.js
//vanilla js version of https://gist.github.com/sebz/efddfc8fdcb6b480f567
var lunrIndex,
$results,
pagesIndex;
// Initialize lunrjs using our generated index file
function initLunr() {
var request = new XMLHttpRequest();
request.open('GET', 'js/lunr/index.json', true);
@Guidoom
Guidoom / gist:d5db0a76ce669b139271a528a8a2a27f
Last active September 17, 2024 17:56
Sample odoo.conf file
[options]
#
# WARNING:
# If you use the Odoo Database utility to change the master password be aware
# that the formatting of this file WILL be LOST! A copy of this file named
# /etc/odoo/openerp-server.conf.template has been made in case this happens
# Note that the copy does not have any first boot changes
#-----------------------------------------------------------------------------
# Odoo Server Config File - TurnKey Linux
@anvk
anvk / psql_useful_stat_queries.sql
Last active July 12, 2024 11:28
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@joshdover
joshdover / README.md
Last active September 28, 2023 21:38
Idiomatic React Testing Patterns

Idiomatic React Testing Patterns

Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.

Setup

I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a beforeEach. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern that gives great defaults for each test example but allows every example to override props when needed:

@beaverb1ll
beaverb1ll / ExportChromePasswords.js
Last active January 18, 2017 12:00 — forked from cmatskas/ExportChromePasswords.js
ExportChromePasswords.js
var decryptedRow="";
var pm = PasswordManager.getInstance();
var model = pm.savedPasswordsList_.dataModel;
var pl = pm.savedPasswordsList_;
for(i=0;i<model.length;i++){
PasswordManager.requestShowPassword(i);
};
setTimeout(function(){
decryptedRow += '"hostname","username","password","formSubmitURL","httpRealm","usernameField","passwordField"';
for(i=0; i<model.length; i++){
@morenoh149
morenoh149 / mysql.sql
Last active November 29, 2023 11:44
role based access control schemas in mysql, postgres and sqlite
/*
* Create Tables
*/
CREATE TABLE IF NOT EXISTS `PREFIX_permissions` (
`ID` int(11) NOT NULL auto_increment,
`Lft` int(11) NOT NULL,
`Rght` int(11) NOT NULL,
`Title` char(64) NOT NULL,
`Description` text NOT NULL,
@bishboria
bishboria / springer-free-maths-books.md
Last active September 17, 2024 05:30
Springer made a bunch of books available for free, these were the direct links
@motanelu
motanelu / house.py
Last active November 7, 2019 14:52
Finding a house with python
import scrapy
import peewee
import re
import urllib
import cStringIO
from PIL import Image
from playhouse.db_url import connect
db = connect('mysql://root:@127.0.0.1/house')