Skip to content

Instantly share code, notes, and snippets.

@appel
appel / search-engines-import-export-chrome-edge-brave.md
Last active April 28, 2024 03:08
Export and import search engines from Chrome/Edge to Brave (bonus: Firefox to Firefox)

Export and import search engines from Chrome/Edge/Brave to Chrome/Edge/Brave

Bonus: Firefox to Firefox, see instructions at the bottom

As discussed here: brave/brave-browser#695

Thanks to the excellent answer by @Redsandro I was able to do this on Windows, which I'll document below because my future self will inevitably find this via Google a few years from now. Since it's using SQLite it should not be too hard to adapt for Macos and Linux.

Edit: this method still worked as of 9/3/2023. :)

@mbinna
mbinna / effective_modern_cmake.md
Last active April 28, 2024 03:08
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@siracusa
siracusa / Pro Display XDR at 120Hz bandwidth calculation.md
Last active April 28, 2024 03:07
Pro Display XDR at 120Hz bandwidth calculations

From Jonathan Dietz, Jr.:

Almost all new displays employ VESA Coordinated Video Timings using Reduced Blanking Timing Version 2 (CVT-RBv2) which adds a small amount of overhead to the video signal. This overhead includes 80 additional horizontal pixels and enough additional lines to meet the 460 µs minimum vertical blanking interval requirement. You can download an Excel spreadsheet from VESA that will do all the calculations for you, but the math is pretty simple:

460 / ((1000000 / [refresh rate in Hz] - 460) / [vertical resolution])

To get an integer number of lines, you round this result down and add 1. So for Pro Display XDR resolution at 120 Hz that would work out to:

460 / (1000000 / 120 - 460) / 3384) = 197.710 = 198 additional lines

@ritog
ritog / alacritty.toml
Created October 6, 2023 10:58
Example configuration file for Alacritty and simple guide
# $HOME/.config/alacritty/alacritty.toml
# by Rito Ghosh 2023-10-06
# Alacritty now uses TOML formatting for its config files.
# This is a simple example.
# There are the specification here: https://github.com/alacritty/alacritty/blob/master/extra/man/alacritty.5.scd
# It is not obvious how it translates to TOML. But it is extremely straightforward.
# example: WINDOW, COLORS, etc. are tables, and should be represented as [window], [colors], respectively.
@andrezrv
andrezrv / get-admin-path.php
Created October 30, 2014 21:18
Obtain path to wp-admin directory in WordPress.
<?php
/**
* Obtain the path to the admin directory.
*
* @return string
*/
function my_plugin_get_admin_path() {
// Replace the site base URL with the absolute path to its installation directory.
$admin_path = str_replace( get_bloginfo( 'url' ) . '/', ABSPATH, get_admin_url() );
@azk-mochi
azk-mochi / llvm-clang6.0.0-build.sh
Last active April 28, 2024 03:05
Script to build LLVM+Clang for jailbroken iOS (ARM64)
#LICENSE: retain the following license
#BSD 3-Clause "New" or "Revised" License
#and this: https://github.com/leetal/ios-cmake/blob/master/LICENSE.md
#Tested on LLVM 6.0.0 and Clang 6.0.0
#using XCode 9.1, iOS11.1 SDK
#make build directory
mkdir llvm-clang-ios
@mihow
mihow / load_dotenv.sh
Last active April 28, 2024 03:02
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@vladwa
vladwa / SSH.py
Created December 31, 2017 07:30
Python code to execute command as a sudo user over ssh connection on a remote server using "paramiko" module. On The code snippet establishes connection and executes the command and return the status and output of the executed command.
import logging
import paramiko
class SSH:
def __init__(self):
pass
def get_ssh_connection(self, ssh_machine, ssh_username, ssh_password):
"""Establishes a ssh connection to execute command.
:param ssh_machine: IP of the machine to which SSH connection to be established.
@tatumroaquin
tatumroaquin / archlinux-qemu-kvm.md
Last active April 28, 2024 03:00
QEMU-KVM Installation for Arch Linux

Arch Linux QEMU-KVM

install all necessary packages

sudo pacman -S virt-manager virt-viewer qemu qemu-arch-extra \
edk2-ovmf vde2 ebtables dnsmasq bridge-utils openbsd-netcat libguestfs

enable libvirt daemon

@GhibliField
GhibliField / 计算机类学术论文 28个常见出版社一般写法.md
Last active April 28, 2024 02:54
计算机类学术论文 28个常见出版社一般写法(参考文献用)
序号 出版社一般写法 出版地 备注
1 AAAI Menlo Park, CA Association for the Advancement of Artificial Intelligence
2 Academic 同Elsevier Academic Press is part of Elsevier
3 Academy Press New York/ London/ Paris/ San Diedo,CA/ San Francisco,CA/ Sao Paulo/ Sydney/ Tokyo/Toronto AP,Academy Press
4 ACL Stroudsburg,PA Association for Computational Linguistics
5 ACM New York, NY ACM Press,Association for Computing and Machinery
6 AP Professional Boston,MA/ San Diedo,CA/New York/ London/ Sydney/ Tokyo/ Toronto  
7 Chapman & Hall London/ Glasgow/ Weinheim/ New York/ Madras CH