Skip to content

Instantly share code, notes, and snippets.

View lumenwrites's full-sized avatar

lumenwrites lumenwrites

View GitHub Profile
@lumenwrites
lumenwrites / ginkgo_mousetrap.js
Last active November 5, 2016 23:49
This script creates a shortcut (Alt+d) that adds a tag with the current date at the end of the card.
app.get('cards').models.map(function(c) {
Mousetrap.bind('alt+d', function(e) {
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10) {
dd='0'+dd
}
def slice_pizza(number_of_friends, number_of_slices):
# Cut pizza in half
number_of_slices = number_of_slices*2
# Is there enough slices for everybody?
if number_of_slices >= number_of_friends:
# If yes - return our slices, it's time to eat pizza!
return number_of_slices
else:
# If not - then cut it in half once again.
@lumenwrites
lumenwrites / Pizza
Last active October 28, 2016 05:15
pizza.py
def
.RES-keyNav-activeElement, .commentarea .RES-keyNav-activeElement .md, .commentarea .RES-keyNav-activeElement.entry .noncollapsed {
background-color: white !important;
}
.link.last-clicked {
border: none;
}
* {
color:grey!important;
function challengeUser (){
var xhr = new XMLHttpRequest();
var id = 58542; //Fuego bot user id
var url = "http://online-go.com/api/v1/players/"+id+"/challenge/";
xhr.open("POST", url, true );
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Authorization", "Bearer " + accessToken);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {