Skip to content

Instantly share code, notes, and snippets.

/******************
* minesweeper.js *
******************
*
* So much for Asimov's Laws. They're actually trying to kill
* you now. Not to be alarmist, but the floor is littered
* with mines. Rushing for the exit blindly may be unwise.
* I need you alive, after all.
*
* If only there was some way you could track the positions
@notyal
notyal / improved-blackboard-updates.user.js
Last active May 23, 2017 20:44
Improve the BlackBoard Updates page by moving the location of the dismiss button
// ==UserScript==
// @name Improved BlackBoard Updates
// @namespace https://gist.github.com/notyal/78e27dc4496a75d94d4b47f984212876
// @version 1.01
// @description Improve the BlackBoard Updates page by moving the location of the dismiss button
// @author Layton Nelson
// @include https://bb.its.iastate.edu/webapps/streamViewer/streamViewer?cmd=view&streamName=alerts*
// @include https://dmacc.blackboard.com/webapps/streamViewer/streamViewer?cmd=view&streamName=alerts*
// @run-at document-idle
// @grant none
@notyal
notyal / osx-defaults.sh
Created September 10, 2016 16:26
OSX Defaults
#!/bin/bash
# fix keyrepeat
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 15
# make screensaver more secure
sudo defaults write com.apple.screensaver askForPasswordDelay -int 0
# disable emailing page on accident
@notyal
notyal / intst235-calendar-improved.user.js
Last active October 10, 2016 23:53
Improve INTST 235 class calendar
// ==UserScript==
// @name INTST 235 Calendar Improved
// @namespace https://gist.github.com/notyal/7d54b74e537183fa9a12ba27ff3cb2d4
// @version 1.0
// @description Scroll to next assignment based on current date.
// @author Layton Nelson
// @match https://dl.dropboxusercontent.com/s/q39fy232p8li9na/calendar_235_f16.html?dl=0
// @grant none
// @downloadURL https://gist.github.com/notyal/7d54b74e537183fa9a12ba27ff3cb2d4/raw/intst235-calendar-improved.user.js
// @updateURL https://gist.github.com/notyal/7d54b74e537183fa9a12ba27ff3cb2d4/raw/intst235-calendar-improved.user.js
# Copyright 2014-2015 Joe Block <jpb@unixorn.net>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@notyal
notyal / factorio.service
Last active January 30, 2023 14:51
/lib/systemd/system/factorio.service
[Unit]
Description=Factorio Server
Wants=network-online.target
After=network-online.target
StartLimitIntervalSec=600
StartLimitBurst=5
[Service]
ExecStart=/opt/factorio/bin/x64/factorio --start-server /opt/factorio/world.zip
User=factorio
@notyal
notyal / sdr-setup.sh
Last active April 23, 2018 22:02
Install Lime Suite, SoapySDR, GNU Radio, Pothos, and Gqrx
#!/bin/sh
# Tested on Lubuntu 16.04.4
sudo add-apt-repository -y ppa:bladerf/bladerf
sudo add-apt-repository -y ppa:ettusresearch/uhd
sudo add-apt-repository -y ppa:myriadrf/drivers
sudo add-apt-repository -y ppa:myriadrf/gnuradio
sudo add-apt-repository -y ppa:gqrx/gqrx-sdr
sudo add-apt-repository -y ppa:pothosware/framework
sudo add-apt-repository -y ppa:pothosware/support
@notyal
notyal / export-slack-emoji.py
Created April 14, 2017 06:47
Simple script to download each custom emoji saved in Slack
#!/usr/bin/env python
# Simple script to download each custom emoji saved in Slack
################################################################################
# Copyright (c) 2017 Layton Nelson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
// ==UserScript==
// @name Fix XDA Sponsored Posts
// @namespace https://gist.github.com/notyal/15af5f6bf883267cc407f5aa2adeeedd
// @version 1.0
// @description Make it easier to skim through the actual XDA blog posts.
// @author Layton Nelson
// @match https://www.xda-developers.com/*
// @grant none
// @downloadUrl https://gist.github.com/notyal/15af5f6bf883267cc407f5aa2adeeedd/raw/fix-xda-sponsored-posts.user.js
// @updateURL https://gist.github.com/notyal/15af5f6bf883267cc407f5aa2adeeedd/raw/fix-xda-sponsored-posts.user.js
#!/usr/bin/env python2
from googlefinance import getQuotes
import sys
import csv
with open(sys.argv[1], 'rb') as file:
reader = csv.reader(file)
for i, row in enumerate(reader):
if i > 0: # skip header
stock = row[4]