Skip to content

Instantly share code, notes, and snippets.

@tmonjalo
tmonjalo / list-fftabs.py
Created September 13, 2018 10:42
List all Firefox tabs with title and URL
#! /usr/bin/env python3
"""
List all Firefox tabs with title and URL
Supported input: json or jsonlz4 recovery files
Default output: title (URL)
Output format can be specified as argument
"""
" deoplete.vim contains vim settings relevant to the deoplete autocompletion
" plugin
" for more details about my neovim setup see:
" http://afnan.io/2018-04-12/my-neovim-development-setup/
" deoplete options
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_smart_case = 1
" disable autocomplete by default
@den-crane
den-crane / gist:6eff375752a236a456e1b3dc2ca7db62
Last active September 30, 2023 08:43
Clickhouse example AggregatingMergeTree, (max, min, avg ) State / Merge
DROP TABLE IF EXISTS requests;
CREATE TABLE requests (
request_date Date,
request_time DateTime,
response_time Int,
request_uri String)
ENGINE = MergeTree(request_date, (request_time, request_uri), 8192);
@androidfred
androidfred / advanced_anki_deck_editing.md
Last active April 27, 2024 04:25
Advanced Anki deck editing made simple (ish)

Advanced Anki deck editing made simple (ish)

Anki is a great open source flashcard app that can be used to learn anything.

This Gist is a full end to end example of how to:

  • export Anki decks from Anki
  • import Anki decks into MySQL
  • edit Anki decks using MySQL
  • export Anki decks from MySQL
@hygull
hygull / LICENSE KEY FOR SUBLIME TEXT 3 BUILD 3143.md
Last active December 16, 2023 19:30
LICENSE KEY FOR SUBLIME TEXT 3 BUILD 3143

STEPS

  • Click on Help menu

  • Select Enter License

  • Then paste given KEY given at bottom

  • Finally click on Use License

@setzer22
setzer22 / README.md
Last active December 2, 2023 14:03
Linux command to hibernate and then reboot into a different OS

Linux command to hibernate and then reboot into a different OS

In this document I describe my setup about how to add a menu shortcut that will hibernate and reboot the system into a different OS (in my case, Windows), and then restore linux on the next reboot.

For this, I'll be using Arch Linux with systemd-boot as my boot manager, but in practice any bootloader that handles the LoaderEntryOneShot (a.k.a. BootNext) efivar should work.

NOTE It is advisable to not do this with window's fast boot feature active, since alternating the hibernation of two systems can cause shared partitions to get corrupted. However, if additional steps are taken in order to ensure the shared partition are unmounted before reboot, or no partitions are shared between the two OSs, this can be made to work with fastboot enabled which should give quite a boost in Windows' startup time.

Set the LoaderEntryOneShot/BootNext EFI variable

@junegunn
junegunn / ag-change
Last active May 28, 2021 02:13
Restarting source command
#!/usr/bin/env bash
ag_source() {
local query
[ -z "$1" ] && query="^(?=.)" || query="$1"
ag --nogroup --column --color "$query" 2> /dev/null
}
filter() {
local query="$1"
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 3, 2024 11:35
Hyperlinks in Terminal Emulators
@arsham
arsham / go_cpu_memory_profiling_benchmarks.sh
Last active November 20, 2023 03:42
Go cpu and memory profiling benchmarks. #golang #benchmark
go test -run=. -bench=. -benchtime=5s -count 5 -benchmem -cpuprofile=cpu.out -memprofile=mem.out -trace=trace.out ./package | tee bench.txt
go tool pprof -http :8080 cpu.out
go tool pprof -http :8081 mem.out
go tool trace trace.out
go tool pprof $FILENAME.test cpu.out
# (pprof) list <func name>
# go get -u golang.org/x/perf/cmd/benchstat
benchstat bench.txt