Skip to content

Instantly share code, notes, and snippets.

View stpettersens's full-sized avatar

Sam Saint-Pettersen stpettersens

View GitHub Profile
@stpettersens
stpettersens / build-reicast-deb.sh
Last active May 1, 2020 14:25 — forked from bmaupin/build-reicast.sh
Build Reicast emulator on Ubuntu/Debian
# Install prerequisites
sudo apt-get -y install build-essential libasound2 libasound2-dev libegl1-mesa-dev libgl1-mesa-dev libgles2-mesa-dev mesa-common-dev libudev-dev
# Build Reicast
git clone https://github.com/reicast/reicast-emulator.git
cd reicast-emulator
git checkout master # Make sure on 'master' branch so will find the necessary subdir (not in alpha branch).
cd shell/linux
make
# Run Reicast
@stpettersens
stpettersens / github-search-toggler.user.js
Last active September 14, 2017 19:46
User script to toggle between a global search and repo searches on GitHub.
// ==UserScript==
// @name GitHub SearchToggler
// @namespace 87901be6f9d184fd17613010a80448e2
// @version 0.2
// @description Toggle between a global search and repo searches on GitHub.
// @author Sam Saint-Pettersen <s.stpettersen+github@gmail.com>
// @match https://github.com/*
// @icon https://github.com/favicon.ico
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==
// ==UserScript==
// @name Duolingo Trim tree
// @namespace 9a84a9d7b3fef7de9d2fd7155dcd794c
// @description Hides all golden skills with a button.
// @author Arek Olek
// @match https://www.duolingo.com/*
// @icon https://s32.postimg.org/8zxj3evit/duolingo.png
// @grant GM_getValue
// @grant GM_setValue
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
@stpettersens
stpettersens / ecosia-trees.user.js
Last active September 14, 2017 19:39
User script to display estimated number of trees planted with Ecosia.
// ==UserScript==
// @name Ecosia Trees Planted
// @namespace 481487dd5200e3aa69b16a9d80fa5f75
// @version 0.3
// @description Display estimated number of trees planted with Ecosia.
// @author Sam Saint-Pettersen <s.stpettersen+github@gmail.com>
// @match https://www.ecosia.org/*
// @icon https://s2.postimg.org/407qv942h/small-tree-icon-0.jpg
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==
@stpettersens
stpettersens / Dockerfile
Last active July 20, 2017 14:06
Dockerfile for a Node.js-based application; based on @phusion 's base-image.
#
# Dockerfile for a Node.js-based application; derived from @phusion's container
# (Docker optimized Ubuntu 16.04 LTS system phusion/base-image:latest container
# - https://github.com/phusion/baseimage-docker/blob/master/image/Dockerfile).
#
# saintpettersens/docker-nodejs
#
FROM phusion/baseimage:latest
@stpettersens
stpettersens / talkingclock.rs
Last active July 23, 2017 12:24
A /r/dailyprogrammer challenge.
/*
Talking clock
Command line application which says the time.
Copyright 2017 Sam Saint-Pettersen.
Released under the MIT License.
*/
extern crate clioptions;
extern crate litepattern;
@stpettersens
stpettersens / paintcalc.rs
Last active June 23, 2017 21:40
Utility to calculate the volume of paint needed to paint a room of supplied dimensions [in Rust].
/*
Utility to calculate the volume of paint needed to
paint a room of supplied dimensions.
Sam Saint-Pettersen, 2017.
*/
extern crate clioptions;
use clioptions::CliOptions;
use std::io::stdin;
use std::process::exit;
@stpettersens
stpettersens / rustup-init.sh
Created June 8, 2017 19:46
Script to install Rust on CI; copied from Travis CI's support for Rust.
#!/bin/sh
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
@stpettersens
stpettersens / netsh.cc
Created May 16, 2017 10:31
Spoof netsh command in C++.
/*
Spoof netsh command.
Public domain.
- Sam Saint-Pettersen.
*/
#include <iostream>
int main() {
std::cout << "Name : DUMMY_WIFI" << std::endl;
@stpettersens
stpettersens / netsh.cmd
Last active May 11, 2017 18:35
Spoof netsh command.
@rem spoof netsh command to test SSID library on Appveyor.yml
echo Name : DUMMY_WIFI
echo State : connected
echo SSID : DUMMY_ID
echo Profile : DUMMY_ID