Skip to content

Instantly share code, notes, and snippets.

@corbindavenport
corbindavenport / autorun.inf
Created April 17, 2015 00:09
OneDrive autorun.inf
[AutoRun]
OPEN=Sync\SyncDriver.TrayIcon.exe
ICON=Sync\OneDrive.ico
ACTION=Start OneDrive Sync
LABEL=OneDrive
@corbindavenport
corbindavenport / sample.js
Created May 2, 2015 01:22
Nimbus example extension
// Extension information
var extension = {
name: "Test Extension",
description: "This is an example of an extension.",
version: "1.0"
};
// Main function
@corbindavenport
corbindavenport / minecraftinstall.txt
Created July 7, 2015 14:06
Minecraft installation
bash <(wget -O- http://goo.gl/8nCl35)
@corbindavenport
corbindavenport / guide.md
Created November 3, 2015 17:57
Favorites still exist!

Twitter left the code in for favorites/stars when the moved to hearts. You can still see them if you have Chrome/Opera/Safari (or any browser with a JavaScript console).

Use the keyboard shortcut Command + Option + J (Mac) or Control + Shift + J (Windows/Linux) to open the Chrome Dev Console. This might be different on other browsers.

Click the Console tab, paste this in, and press enter:

$( ".js-actionFavorite" ).each(function( index ) {$(this).html('<button class="ProfileTweet-actionButton js-actionButton js-actionFavorite" type="button"><div class="IconContainer js-tooltip" data-original-title="Like"><span class="Icon Icon--favorite"></span><span class="u-hiddenVisually">Favorite</span></div><div class="IconTextContainer"><span class="ProfileTweet-actionCount"><span class="ProfileTweet-actionCountForPresentation" aria-hidden="true">1</span></span></div></button>');});
@corbindavenport
corbindavenport / setup.sh
Last active May 14, 2024 08:09
My personal setup script for KDE Neon
# This is designed for KDE Neon
# To run this:
# bash <(curl -s https://gist.githubusercontent.com/corbindavenport/9e164da69ab9de884dfbb6ef9c29a5aa/raw/setup.sh)
# Set device hostname and get sudo
sudo echo "Set the name for this device (no spaces!):"
read hostname
hostnamectl set-hostname $hostname
# Update packages
@corbindavenport
corbindavenport / screenshot-tool.sh
Last active September 22, 2022 13:35
Bash script for automatically capturing screenshots
# How to use:
# ./screenshot-tool.sh [export directory] [seconds between screenshots]
# Example: ./screenshot-tool.sh ~/Pictures 5
# Install scrot if it's not already installed
if ! [ -x "$(command -v scrot)" ]; then
sudo apt install -y scrot
fi
# Set directory to parameter $1
@corbindavenport
corbindavenport / cpu.dart
Last active December 30, 2023 05:40
Get CPU architecture in Dart
import 'dart:io' as io;
// Function get current CPU architecture
Future<String> getCPUArchitecture() async {
if (io.Platform.isWindows) {
var cpu = envVars['PROCESSOR_ARCHITECTURE'];
return cpu;
} else {
var info = await io.Process.run('uname', ['-m']);
var cpu = info.stdout.toString().replaceAll('\n', '');
@corbindavenport
corbindavenport / rosetta.dart
Created July 24, 2021 00:29
Check for MacOS Rosetta compatibility layer in Dart
// Function to verify Rosetta compatibility layer is enabled on ARM macOS
void checkRosetta() async {
var cpu = await getCPUArchitecture();
var rosettaInstalled = await io.Directory(
'/Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist')
.exists();
if (io.Platform.isMacOS && (cpu == 'arm64')) {
if (rosettaInstalled) {
print('[ OK ] Rosetta compatibility layer is already installed.');
} else {
@corbindavenport
corbindavenport / test-android.sh
Last active August 13, 2021 07:17
Test local WebExtension in Firefox for Android
: '
This is a script for easier testing of a WebExtension on Firefox for Android. It is a wrapper around Mozilla web-ext tool, without the need to check the list of ADB devices manually. It also automates using a Firefox-specific manifest, because Firefox for Android requires "browser_specific_settings" to be included in the manifest with the extension ID, but that string sometimes causes issues in Chromium-based browsers.
Assumed folder structure:
./test-android.sh (this script!)
./manifest.json
./manifest-firefox.json
More info about web-ext: https://extensionworkshop.com/documentation/develop/getting-started-with-web-ext/
@corbindavenport
corbindavenport / stylus-asana.json
Last active December 2, 2021 21:28
This is a custom style for the Stylus browser extension that removes link popups in Asana. To install, click the "Raw" button below, save the file, go to Stylus settings, click Import, then pick the downloaded file.
[
{
"settings": {
"openEditInWindow": false,
"openEditInWindow.popup": false,
"windowPosition": {},
"show-badge": true,
"disableAll": false,
"exposeIframes": false,
"newStyleAsUsercss": false,