Skip to content

Instantly share code, notes, and snippets.

@LarryIsBetter
LarryIsBetter / Linux Laptop Optimizations.md
Last active April 24, 2024 23:58
Linux Laptop Optimizations

I have a website now that includes a more dumbed down but straight forward version of this guide that isnt basied towards Arch Linux but considers most distros. https://linuxguidance.net/improve-battery-and-optimize-your-linux-laptop/

Everything I do in this guide is mostly taken from the Arch Wiki, and is for Arch Linux, obviously this can probably be applied to other Linux distributions especially Arch based ones, this guide is for people who want a laptop with similar effciency they had on Windows or MacOS. I hate the excuse of having to compromise on Linux to have good battery or thermals on laptops.

Please think of this guide as more of a starting point, if you're serious about fully optimizing your laptop research your laptop and the hardware inside of it as that can get you even further down the rabbit hole.

This guide assumes you have a relatively modern laptop with at least an SSD from the factory, if you don't, don't worry you can still probably follow this guide perfectly, if you have a 32-b

/**
* Check out the blog post, "How to mock a third party ES6 export in Vitest", at:
* https://dev.to/erikpuk/how-to-mock-a-third-party-es6-export-in-vitest-38ff
*/
// Import the module:
import * as Firestore from "firebase/firestore"
import { test, vi } from "vitest"
type FakeFirestore = { onSnapshot(this: void): void }
@brthor
brthor / README.md
Created March 23, 2018 02:41
Docker network create error: "Error response from daemon: failed to check bridge interface existence: numerical result out of range"

I recently hit this problem, while using ansible to create docker networks:

- name: Construct Default docker networks
  shell: "docker network create 
            -o com.docker.network.bridge.enable_icc=false 
            -o com.docker.network.bridge.name={{item.networkName}}
            --subnet {{item.subnet}} {{item.networkName}}"
  with_items: "{{ docker_networks }}"

#Apple的App Analytics统计平台你必须知道的Q&A整理与翻译

Apple最近在iTunesConnect里最新发布了App Analytics统计平台,提供了现有友盟统计平台和自有统计平台无法统计的数据,具有自己的独有特点,尤其是下面几个最让人头疼的流量分析转化,可以在App Analytics里得以解决,例如:

  1. 推广链接转化
  2. 网站流量来源
@thomasjsn
thomasjsn / laravel-queue.service
Last active April 24, 2024 23:54
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker
@jordanlambrecht
jordanlambrecht / autoDeleteGmail.js
Last active April 24, 2024 23:52
Auto Delete / Archive Emails in Gmail
function autoDelete() {
console.log('Started autoDelete run.');
var delayDays = 2;
var maxDate = new Date();
maxDate.setDate(maxDate.getDate()-delayDays);
var label = GmailApp.getUserLabelByName("delete me");
var threads = label.getThreads();
if(threads.length > 0){
console.log('Found ' + threads.length + ' emails marked for deletion.');
@Ichunjo
Ichunjo / fine_dehalo.py
Last active April 24, 2024 23:48
fine_dehalo rewrite
from __future__ import annotations
from math import ceil, floor
from typing import Optional, Sequence
import vapoursynth as vs
from lvsfunc.kernels import BSpline, Lanczos, Mitchell
# https://github.com/Varde-s-Forks/RgToolsVS
from rgvs import minblur, repair
from vsmask.better_vsutil import join, split
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.Style;
import net.kyori.adventure.text.format.TextDecoration;
import net.minestom.server.utils.StringUtils;
import java.util.*;
public class ComponentWrapper {
@trongthanh
trongthanh / gist:2779392
Last active April 24, 2024 23:46
How to move a folder from one repo to another and keep its commit history
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.
@IgorHalfeld
IgorHalfeld / addSibs.js
Last active April 24, 2024 23:44
add sibelius to any website
function addSibs () {
const div = document.createElement('div')
const img = document.createElement('img')
div.style.position = 'fixed'
div.style.zIndex = '99999999'
div.style.right = '100px'
div.style.bottom = '0px'
div.appendChild(img)