Skip to content

Instantly share code, notes, and snippets.

View ThinkpadX61_AutoRotate.sh
#!/bin/bash
old="0"
while true; do
if [[ -e /sys/devices/platform/thinkpad_acpi/hotkey_tablet_mode ]]; then
new=`cat /sys/devices/platform/thinkpad_acpi/hotkey_tablet_mode`
if [[ $new != $old ]]; then
if [[ $new == "1" ]]; then
echo "Rotate to landscape"
xsetwacom set "Wacom Serial Penabled Pen stylus" rotate half
@G33kDude
G33kDude / bb-grades-export.js
Created May 3, 2019
Exports grades from your student blackboard grade center
View bb-grades-export.js
(function(){
let doc = document;
if (doc.querySelector('iframe#mybbCanvas')) {
doc = doc.querySelector('iframe#mybbCanvas')
.contentDocument.querySelector('iframe#right_stream_mygrades')
.contentDocument;
}
let download = function(title, text) {
View MarkdownToBBCode.ahk
#NoEnv
SetBatchLines, -1
Gui, Add, Button, gDoConversion, Convert from Markdown to BBCode
Gui, Add, Edit, w640 h480 vPost
Gui, Show
return
GuiClose:
ExitApp
@G33kDude
G33kDude / mjpeg.py
Last active Apr 18, 2021
Stream a webcam over HTTP using the MJPEG protocol
View mjpeg.py
#!/usr/bin/env python2
import time
# HTTP
import BaseHTTPServer
import SimpleHTTPServer
import SocketServer
import threading
@G33kDude
G33kDude / BlackboardDismissAll.user.js
Last active Dec 17, 2017
Userscript to add a "Dismiss All" button to the Blackboard Learn updates page
View BlackboardDismissAll.user.js
// ==UserScript==
// @name Blackboard Dismiss All Updates
// @namespace https://github.com/G33kDude
// @version 0.1
// @description Adds a "Dismiss All" button to the Blackboard Learn updates page
// @author GeekDude
// @match *://*.blackboard.com/webapps/streamViewer/streamViewer*
// @grant none
// @update https://gist.github.com/G33kDude/4ef48d78fde6cb07490a1c1de3ba79d0/raw/BlackboardDismissAll.user.js
// ==/UserScript==
@G33kDude
G33kDude / HideQuickLogout.user.js
Last active Aug 9, 2017
Hides the quick logout button for the AutoHotkey forums
View HideQuickLogout.user.js
// ==UserScript==
// @name Hide quick logout
// @namespace https://github.com/G33kDude
// @version 0.1
// @description Hides the quick access logout button in the toolbar next to the notifications
// @author GeekDude
// @match *://autohotkey.com/boards/*
// @grant none
// @updateURL https://gist.github.com/G33kDude/9f9ec5281a8d574847ca28540425343b/raw/HideQuickLogout.user.js
// ==/UserScript==
View TipsAndTricks.md

GeekDude's Tips, Tricks, and Standalones

This is intended to be a useful reference for any AutoHotkey scriptwriter regardless of their experience. If you find any of the examples to be confusing please let me know so I can update them for clarity.

Table of Contents

View Volume.ahk
#NoEnv
SetBatchLines, -1
#MaxHotkeysPerInterval 200
#Include <VA>
; Create the slider window
Gui, Add, Progress, w100 h20 x0 y0 Range0-100 vVolSlider, 0
Gui, Add, Text, w100 h20 x0 y0 vVolText BackgroundTrans Center +0x200, 0
Gui, +AlwaysOnTop -Caption +ToolWindow
Gui, Show, Hide w100 h20 x0 y0, Volume
View ev3dev_ro.md

Making a read-only ev3dev system

Mounting ev3dev.img

Start by downloading the latest ev3dev release from http://www.ev3dev.org/download/.

Once downloaded, set it up as a loop device. Find out what the first unused loop device is by running losetup -f. This tells you which loop device will be used once set up. On my system, it printed /dev/loop0. Now we can run the command to actually set up the loop device:

View Array_Gui.ahk
Array_Gui(Array, Parent="") {
if !Parent
{
Gui, +HwndDefault
Gui, New, +HwndGuiArray +LabelGuiArray +Resize
Gui, Margin, 5, 5
Gui, Add, TreeView, w300 h200
Item := TV_Add("Array", 0, "+Expand")
Array_Gui(Array, Item)