Skip to content

Instantly share code, notes, and snippets.

#include <bits/stdc++.h>
#define MAX 300
#define INF (numeric_limits<int>::max()/2)
using namespace std;
typedef int weight;
typedef int id;
vector<int> dijkstra(int start, vector< vector < pair <weight, id> > >& graph) {
@clisamurai
clisamurai / Nucleus.md
Last active April 24, 2024 13:29
A simple text editor in a bookmarklet

Nucleus

Nucleus is a plain-text editor hidden in a bookmarklet. It is fully responsive and supports all HTML5-supporting browsers. Nucleus is ultra-lightweight - it doesn't support any formating at all and saves itself along with your files when you save it. You can save Nucleus documents in PDF format by utilising the print-to-PDF functionality of your browser. It is also fully customizable and open-source - simply change the source code.

Requirements

  • An HTML5 compliant web browser

Installation

@clisamurai
clisamurai / Bullseye.py
Last active January 12, 2016 21:24
Bullseye is a computerized creator of the puzzles variously known as word polygons, word targets and plenty of other names. Bullseye is a Python program which uses relies on Python 2.7 and was created by Mitchell Palmer as a learning project.
import random
import pprint
import textwrap
pp = pprint.PrettyPrinter(indent=4)
print "Welcome to the Bullseye Puzzle!"
print textwrap.wrap("Bullseye is a computerized creator of the puzzles variously known as word polygons, word targets and plenty of other names. Bullseye is a Python program which uses relies on Python 2.7 and was created by Mitchell Palmer as a learning project")
def shuffle_word(word):
word = list(word)
@clisamurai
clisamurai / Scratchpad local source code
Last active January 13, 2016 23:00
Welcome to Scratchpad local
data:text/html, <html> <title>Scratchpad.local</title> <style> body { font: 1.5rem/1.5 monospace; max-width: 60rem; margin: 0 auto; padding: 4rem; } @media screen and (max-width: 720px) { .hide { visibility: hidden; height: 5px; } } @media screen and (max-width: 620px) { .hide { height: 0px; } body { max-width: 100vw; padding: 0rem; margin: 10px; } } @media print { .hide { visibility: hidden; height: 0px; } body { padding: 0rem; } } </style> <body> <p class="hide"><b>Directions: </b> Press Ctrl/Cmd+S to save | Ctrl/Cmd + O to open | Ctrl/Cmd + P to print <br /> <small>You are viewing, editing or creating a document in Scratchpad.local. There is no autosave functionality. Documents save as HTML files and can be opened in any modern browser.</small> </p> <h1 contenteditable style="font: large;" id="title">Title</h1> <div contenteditable style="height: 100%">Enter content here...</div> <script type="text/javascript"> document.getElementById("title").addEventListener("input", function() { var allHOnes = document.