Skip to content

Instantly share code, notes, and snippets.

Avatar
〽️
Curiouser and curiouser!

Mau Magnaguagno Maumagnaguagno

〽️
Curiouser and curiouser!
View GitHub Profile
View sudoku.rb
# Based on https://eregon.me/blog/2018/02/11/trick-sudoku.html
S = <<PUZZLE.lines.map { |l| l.chomp.chars.map(&:to_i)}
19___8__5
__2_5__89
8_674____
_____4_92
_23_7_81_
56_8_____
____279_3
93__8_1__
@Maumagnaguagno
Maumagnaguagno / char_tester.rb
Created Aug 1, 2017
Test integer to char in Ruby
View char_tester.rb
#encoding: ascii-8bit
puts [
# ...
33.chr == '!',
34.chr == '"',
35.chr == '#',
36.chr == '$',
37.chr == '%',
38.chr == '&',
39.chr == "'",
View treedot.rb
# Based on http://www.graphviz.org/content/generate-directory-tree-dot
def treedot(tree)
nodes = Hash.new {|h,k| h[k] = "node#{h.size}"}
dot = 'digraph tree{
fixedsize=true
splines=ortho
node [style="rounded,filled", fillcolor="#E5E5E5", concentrate=true]'
tree.each {|name,subtree| add(dot, name, subtree, nodes)}
dot << "\n}"
end
@Maumagnaguagno
Maumagnaguagno / assistant.rb
Last active May 6, 2017
Assistant - Execute basic Ruby .travis.yml files locally
View assistant.rb
require 'yaml'
module Assistant
extend self
def test(filename)
data = YAML.load_file(filename)
case data['language']
when 'ruby' then test_ruby(data)
else puts "Language #{data['language']} is unknown"
@Maumagnaguagno
Maumagnaguagno / planning.domains.py
Last active Jul 11, 2017
Scripts to request solver from planning.domains
View planning.domains.py
#!/usr/bin/env python
# More info at http://solver.planning.domains/
import urllib2, json, sys
HELP = """planning.domains.py
Usage:
planning.domains.py domain.pddl problem.pddl [mode=save|compare plan]
Options
mode - specify if it saves to or compares with plan file
@Maumagnaguagno
Maumagnaguagno / README.md
Last active Nov 10, 2016
Optimizing C to know ranges
View README.md
@Maumagnaguagno
Maumagnaguagno / Greasemonkey_Emojis.js
Last active Jul 21, 2017
Github old css copy and patch to avoid changes made to fonts in July 11(2016) and dark header in February 11(2017) using Stylish
View Greasemonkey_Emojis.js
// ==UserScript==
// @name Emojis
// ==/UserScript==
window.addEventListener('load', function() {
var emojis = document.getElementsByClassName("emoji")
//console.log("Emojis:")
//console.log(logos.length)
for(var i = 0; i < emojis.length; ++i)
{
View PDDL-Ace.md

Ace

Ace PDDL

define(function(require, exports, module) {
    "use strict";
    var oop = require("../lib/oop");
    var PDDLHighlightRules = function() {
        var keywordMapper = this.createKeywordMapper({
@Maumagnaguagno
Maumagnaguagno / .travis.yml
Last active Feb 18, 2020
Make Travis-CI push files to other repositories for you when tests pass
View .travis.yml
language: ruby
rvm:
- 2.0.0
env:
global:
- USER="username"
- EMAIL="username@mail.com"
- REPO="name of target repo"
- FILES="README.md foo.txt bar.txt"
- GH_REPO="github.com/${USER}/${REPO}.git"