Skip to content

Instantly share code, notes, and snippets.

marp theme paginate backgroundColor color
true
default
true

Contributing to open source software

@simon-andrews
simon-andrews / mittr_meter_disabler.user.js
Last active November 22, 2019 06:27
MIT Technology Review meter disabler
// ==UserScript==
// @name MIT Tech Review meter disabler
// @version 2
// @match https://www.technologyreview.com/*
// @grant none
// ==/UserScript==
function clearTrackers() {
window.localStorage.removeItem("mittr:meter");
}
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
//System.out.println("Size of magic square: ");
int size = 5; //input.nextInt();
MagicSquare magicSquare = new MagicSquare(size);
import java.util.ArrayList;
import java.util.Random;
class Main
{
public static void main(String[] args)
{
ArrayList<String> oldStudents = new ArrayList<String>();
ArrayList<String> newStudents = new ArrayList<String>();
import datetime
total_pages = 527
pages_read_so_far = 55
current_date = datetime.datetime.now().date()
due_date = datetime.date(2016, 7, 9)
delta = due_date - current_date
days_till_duedate = delta.days + 1
/*
* Copyright [yyyy] [name/org].
*
* Licensed under the GNU General Public License, Version 2, <LICENSE-GPL or
* https://www.gnu.org/licenses/old-licenses/gpl-2.0.html> 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.
*/
#ifdef __cplusplus
#include <iostream>
inline void log_fine(msg) {std::cout << "[FINE] " << msg << std::endl;}
inline void log_info(msg) {std::cout << "[FINE] " << msg << std::endl;}
inline void log_warn(msg) {std::cout << "[WARN] " << msg << std::endl;}
inline void log_fail(msg) {std::cout << "[FAIL] " << msg << std::endl;}
#else
from math import log
def from_oh(OH):
H = 10**-14 / OH
pOH = -log(OH)
pH = 14 - pOH
print("H+: {}".format(H))
print("pOH: {}".format(pOH))
print("pH: {}".format(pH))
print()
@simon-andrews
simon-andrews / install_opencv_3.sh
Created May 3, 2016 21:43
OpenCV 3.1.0 Installer (from source)
git clone https://github.com/itseez/opencv
cd opencv
git checkout 3.1.0
mkdir build
cd build
cmake ..
make -j4
sudo make install
@simon-andrews
simon-andrews / wide_lobsters.css
Created January 9, 2016 19:10
Makes Lobste.rs wider
div#wrapper {
max-width: 90%;
}