Skip to content

Instantly share code, notes, and snippets.

@kentbrew
kentbrew / lang_chrome_osx.md
Last active May 13, 2024 10:40
How to change the Chrome default language on OSX

How to Change your Chrome Default Language

Open up a Terminal window. (If you have never seen Terminal before, go to Spotlight Search and type "Terminal.")

In the Terminal box, try this:

defaults read com.google.Chrome AppleLanguages

If you see this:

@royling
royling / background.js
Last active May 13, 2024 10:39
Click Chrome extension icon to execute scripts on active tab
chrome.action.onClicked.addListener((tab) => {
chrome.scripting.executeScript({
target: {
tabId: tab.id,
},
files: ["content.js"],
});
});
@Acephalia
Acephalia / wpcitwebp.php
Last active May 13, 2024 10:39
Wordpress Convert Image To WebP and Delete Original File On Upload
//Convert uploaded files to webp and delete uploaded file. Imagick needs to be enabled. This can be done via the php config settings in your servers control panel.
function compress_and_convert_images_to_webp($file) {
// Check if file type is supported
$supported_types = ['image/jpeg', 'image/jpg', 'image/png', 'image/webp'];
if (!in_array($file['type'], $supported_types)) {
return $file;
}
// Get the path to the upload directory
@Geczy
Geczy / migrate.sh
Last active May 13, 2024 10:37
Migrate Coolify to a new server
#!/bin/bash
# This script will backup your Coolify instance and move everything to a new server. Docker volumes, Coolify database, and ssh keys
# 1. Script must run on the source server
# 2. Have all the containers running that you want to migrate
# Configuration - Modify as needed
sshKeyPath="$HOME/.ssh/your_private_key" # Key to destination server
destinationHost="server.example.com"
@UnaNancyOwen
UnaNancyOwen / CMakeLists.txt
Last active May 13, 2024 10:36
Drawing Point Cloud retrieve from Velodyne VLP-16
cmake_minimum_required( VERSION 2.8 )
# Create Project
project( solution )
add_executable( project main.cpp )
# Set StartUp Project (Option)
# (This setting is able to enable by using CMake 3.6.0 RC1 or later.)
set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "project" )
import type { V2_HtmlMetaDescriptor, V2_MetaFunction } from "@remix-run/node";
export const mergeMeta = (
overrideFn: V2_MetaFunction,
appendFn?: V2_MetaFunction,
): V2_MetaFunction => {
return arg => {
// get meta from parent routes
let mergedMeta = arg.matches.reduce((acc, match) => {
return acc.concat(match.meta || []);
@floydnoel
floydnoel / git-ignore-cleaner.sh
Last active May 13, 2024 10:36
Remove all files from a Git repo based on the .gitignore file
#!/bin/bash
echo "Cleaning up any git ignored files..."
# copy and paste the line below to get the same results as running this script
git rm --cached `git ls-files -ic --exclude-from=.gitignore`
echo "Finished clean up."
# source: https://stackoverflow.com/questions/13541615/how-to-remove-files-that-are-listed-in-the-gitignore-but-still-on-the-repositor/13541721
@seltzered
seltzered / IllustratorSaveAsSVGs.jsx
Last active May 13, 2024 10:33
Quick little script to batch-convert Illustrator .ai's to .svg's, based on Adobe's sample 'save to pdf's' script. Save it to a jsx, and load it under illustrator. Intended for Illustrator CS6.
/**********************************************************
ADOBE SYSTEMS INCORPORATED
Copyright 2005-2010 Adobe Systems Incorporated
All Rights Reserved
NOTICE: Adobe permits you to use, modify, and
distribute this file in accordance with the terms
of the Adobe license agreement accompanying it.
If you have received this file from a source
@terry90
terry90 / unfollow.js
Last active May 13, 2024 10:32
LinkedIn mass unfollow
const SPEED = 150 // ms
// Open the console and paste this on linkedin.com/feed/following
function unfollowCurrent(elems, callback) {
console.log('Unfollowing ', elems.length, ' contacts')
elems.forEach(
(e, i) =>
setTimeout(() => e.click(), i * SPEED)
)
setTimeout(callback, elems.length * SPEED)
@Mahdisadjadi
Mahdisadjadi / Tight-Binding Calculation of the Band Structure of Silicon.ipynb The band structure of Silicon is calculated using the empirical tight-binding method implemented in the Python programming language. Only interactions between first nearest neighbors are taken into account. The energy splittings for Silicon at symmetry points appear to be somewhat accurate to accepted values, although second neighbors will have …
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.