Skip to content

Instantly share code, notes, and snippets.

View corbindavenport's full-sized avatar

Corbin Davenport corbindavenport

View GitHub Profile
@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 / 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 / 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 / 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 / minecraftinstall.txt
Created July 7, 2015 14:06
Minecraft installation
bash <(wget -O- http://goo.gl/8nCl35)
@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 / 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