Skip to content

Instantly share code, notes, and snippets.

'use strict';
const puppeteer = require('puppeteer');
(async () => {
/* PRECONDITION:
0. download ublock, I used https://github.com/gorhill/uBlock/releases/download/1.14.19b5/uBlock0.chromium.zip
1. run $PATH_TO_CHROME --user-data-dir=/some/empty/directory --load-extension=/location/of/ublock
2. enable block lists you want to use
*/
@nor0x
nor0x / UICollectionView + NSFetchedResultsController.swift
Last active March 21, 2021 12:52 — forked from nazywamsiepawel/UICollectionView + NSFetchedResultsController.swift
UICollectionView + NSFetchedResultsController Swift 3 / iOS 10
var _fetchedResultsController: NSFetchedResultsController<Entity>? = nil
var blockOperations: [BlockOperation] = []
var fetchedResultController: NSFetchedResultsController<Entity> {
if _fetchedResultsController != nil {
return _fetchedResultsController!
}
let fetchRequest: NSFetchRequest<Entity> = Entity.fetchRequest()
let managedObjectContext = (UIApplication.shared.delegate as! AppDelegate).managedObjectContext!
@drinkius
drinkius / storage.swift
Created September 26, 2016 15:15 — forked from avdyushin/storage.swift
CoreData stack for iOS 9 and iOS 10 using Swift 3
//
// Storage.swift
//
// Created by Grigory Avdyushin on 30.06.16.
// Copyright © 2016 Grigory Avdyushin. All rights reserved.
//
import UIKit
import CoreData
@eculver
eculver / protocol-fix.txt
Created March 16, 2015 18:54
How to deal with tmux "protocol version mismatch"
$ tmux attach
protocol version mismatch (client 7, server 6)
$ pgrep tmux
3429
$ /proc/3429/exe attach
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 10, 2024 17:12
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'