Skip to content

Instantly share code, notes, and snippets.

@Seth-Johnson
Seth-Johnson / canvas_class_average.js
Last active June 7, 2018 17:00
Calculates the average class grade based on the mean of each individual assignment. WIP.
// ==UserScript==
// @name Canvas average class grade
// @namespace sethj@ubuntu.com
// @version 0.1a
// @description Calculate class average grade
// @author Seth Johnson
// @match https://egator.greenriver.edu/courses/*/grades
// @grant none
// ==/UserScript==
@Seth-Johnson
Seth-Johnson / .mkd
Last active March 31, 2017 17:50
Give moderators better tooling to detect bad reviewers

Moderators have very little tooling to help deal with consistently bad reviewers. We have [review audits & bans][1] and some fancy stats pages. This is enough to stop true robo-reviewers, people that apply the same action to everything indiscriminately, but it breaks down when it comes to stopping just plain bad reviewers. I'm defining "bad" as reviewers who are otherwise paying attention (they pass all/most audits) but consistently apply wrong actions to things they review, actions they have to be corrected later. I've seen users that tend to "no action needed" most things, even if they are badly in need of an edit, comment, etc and other users who tend to "close & delete" everything, even if it's on-topic or otherwise acceptable. This is where it gets hairy.

I can look at a reviewer's stats and say "wow, 75% of this person's reviews are (no action needed/delete/close/etc) but moderators have no tooling to actually tell if this is pure coincidence or if bad actions are actually being taken, and no too

// ==UserScript==
// @name Admin/mod link changer
// @version 0.1
// @description change the 'mod' and 'history' admin links to point to the daily stats
// @author Seth @ askubuntu.com
// @match *://*.stackexchange.com/*
// @match *://*.stackoverflow.com/*
// @match *://*.superuser.com/*
// @match *://*.serverfault.com/*
// @match *://*.askubuntu.com/*
param(
[int]$startNum = $(throw "starting number is required")
)
#Function preformRename {
Get-ChildItem -filter *.mp3 | Foreach-Object {
$NewName = $_.BaseName -replace "^[0-9][0-9]",$startnum
$startNum += 1
write $NewName
#write $startNum
@Seth-Johnson
Seth-Johnson / userscript.user.js
Last active January 30, 2018 19:10
Show a site specific profile link in chat
// ==UserScript==
// @name Chat site profiler thingy
// @namespace http://askubuntu.com/users/44179
// @include *chat.stackexchange.com/*
// @include *chat.stackoverflow.com/*
// @include *chat.meta.stackexchange.com/*
// @version 1
// @grant none
// ==/UserScript==
// ==UserScript==
// @name Ask Ubuntu Orangifier
// @version 0.1
// @description Changes the bounty colors from blue to orange.
// @author Seth @ Ask Ubuntu
// @match *askubuntu.com/*
// @grant none
// ==/UserScript==
$('.bounty-indicator, .bounty-indicator-tab, .bounty-award').not('.accept-indicator-tab').css('background-color', '#F25E19');
(function(){
var separateThousands = function(n) {
var s = String(n);
s = s.replace(/[1-9][0-9]*/, function(match) {
var r = "";
for (var i = 0; i < match.length; i++) {
r = match[match.length - 1 - i] + r;
if (i % 3 == 2 && i < match.length - 1) {
r = "," + r;
}

Keybase proof

I hereby claim:

  • I am seth-johnson on github.
  • I am sethj (https://keybase.io/sethj) on keybase.
  • I have a public key whose fingerprint is 27DD B98D D6CE 4618 6DAD 97C0 9B4A 13D0 002A 515A

To claim this, I am signing this object:

@Seth-Johnson
Seth-Johnson / gist:9072d70b61f3b7da74d6
Created December 28, 2014 23:38
Gtk testing stuff
from gi.repository import Gtk
win = None
class MyFirstWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="First Class")
self.button1 = Gtk.Button(label="Click me. Quick!")
self.button1.connect("clicked", self.on_button_clicked)
void convertBuffToInt(wchar_t buffer[]) {
int temp = 0;
for (int i = 0; i < sizeof(buffer) / sizeof(buffer[0]); i++) {
if (buffer[i] == '\0') {
break;
}
temp = temp * 10 + ((int)buffer[i] - 48);
}