Skip to content

Instantly share code, notes, and snippets.

//https://habr.com/post/213515/
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB,
IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.msIDBTransaction,
baseName = "baseName",
storeName = "storeName";
function logerr(err){
console.log(err);
@tabacitu
tabacitu / ssh.sql
Created December 29, 2019 10:20
MySQL Dump Large Table Entries In Chunks
## This process can be used to export a huge DB table. I've used it to export a 24GB table,
## containing 146 million records, into chunks of 25 million records, each chunk taking up aprox 500mb each.
##
## Of course, USERNAME, DATABASENAME and TABLENAME need to be replaced with actual values.
## First thing when it's run, it'll ask for that user's password.
##
## COMMAND BREAKDOWN:
## mysqldump - u [username] -p [databasename] [tablename]
## --no-create-info # don't include CREATE and DROP statements in the dump
## --where="" # filter the dumped rows
@alejandro-martin
alejandro-martin / multiple-ssh-keys-git.adoc
Last active May 2, 2024 01:36
Configure multiple SSH Keys for Git

Use Multiple SSH Keys for Git host websites (Github, Gitlab)

This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.

Creating SSH keys

  1. Create SSH directory:

@charlesaloaye
charlesaloaye / gist:d5234275c8ed0bb4510ffaa9670d80aa
Last active May 2, 2024 01:32
2024 JETBRAINS ACTIVATION CODE | PHPSTORM | PYCHARM | Expires October 14, 2024
I2A0QUY8VU-eyJsaWNlbnNlSWQiOiJJMkEwUVVZOFZVIiwibGljZW5zZWVOYW1lIjoiVU5JVkVSU0lEQURFIEVTVEFEVUFMIERFIENBTVBJTkFTIiwiYXNzaWduZWVOYW1lIjoiVGFvYmFv77yaSkVU5YWo5a625qG25r+AIOa0u+W3peS9nOWupCAgcmVuIHpodW4gZGlhbiBtaW5n77yBIiwiYXNzaWduZWVFbWFpbCI6IlJvYmJ5X1dlbmlnZXJAb3V0bG9vay5jb20iLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IkRQTiIsInBhaWRVcFRvIjoiMjAyNC0xMC0xNCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiREIiLCJwYWlkVXBUbyI6IjIwMjQtMTAtMTQiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IlBTIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJJSSIsInBhaWRVcFRvIjoiMjAyNC0xMC0xNCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiUlNDIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOnRydWV9LHsiY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJETSIsInBhaWRVcFRvIjoiMjAyNC0xMC0xNCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiUlNGIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOnRydWV9LHsiY29kZSI6IkRTIiwicGFpZFVwVG8iOiIyMDI0LTEwL
@gbaman
gbaman / HowToOTG.md
Last active May 2, 2024 01:27
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@Pulimet
Pulimet / AdbCommands
Last active May 2, 2024 01:24
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@lmullen
lmullen / gist:3767386
Created September 22, 2012 18:50
Make all markdown files in directory into PDFs
# Produce PDFs from all Markdown files in a directory
# Lincoln Mullen | http://lincolnmullen.com | lincoln@lincolnmullen.com
# List files to be made by finding all *.md files and appending .pdf
PDFS := $(patsubst %.md,%.md.pdf,$(wildcard *.md))
# The all rule makes all the PDF files listed
all : $(PDFS)
# This generic rule accepts PDF targets with corresponding Markdown
@janakamarasena
janakamarasena / secret_gen.rb
Last active May 2, 2024 01:21
Sign In with Apple Client Secret Generator
require "jwt"
key_file = "Path to the private key"
team_id = "Your Team ID"
client_id = "The Service ID of the service you created"
key_id = "The Key ID of the private key"
validity_period = 180 # In days. Max 180 (6 months) according to Apple docs.
private_key = OpenSSL::PKey::EC.new IO.read key_file
@bogdanRada
bogdanRada / customize-mx-master-ubuntu.md
Created April 17, 2020 09:01 — forked from vukhanhtruong/customize-mx-master-ubuntu.md
Custom keymap for Logitech MX Master 2S mouse on Ubuntu

First, install Solaar to see the battery level on the taskbar

sudo apt-get install solaar

To remap the keys, install

sudo apt-get install xbindkeys xautomation
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active May 2, 2024 01:13
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be