Skip to content

Instantly share code, notes, and snippets.

View mvrozanti's full-sized avatar

Marcelo mvrozanti

View GitHub Profile
@sstativa
sstativa / morse.sh
Created November 14, 2017 01:21
Bash Morse code Generator
#!/bin/bash
#script: Morse
#Written by Ole-Jørgen Næss Kolsrud
#Thanks to crunchbangers damo, ehde and aibo!
#Also, thank you, Internet=P
#Dependencies: bash, beep
@Marileal
Marileal / spaceColonization_myMouse.pde
Last active October 14, 2020 02:03
spaceColonization_myMouse
// based on the code of the coding challenge
// by Daniel Shiffman, accessed on:
// https://youtu.be/kKT0v3qhIQY
// needs to be run on Processing (https://processing.org/)
Tree tree;
float min_dist = 5;
float max_dist = 800;
boolean arboriza = false;
@tyuiko
tyuiko / argparsecheetsheet.py
Created April 19, 2016 16:40
argparse cheat sheet
import argparse
parser = argparse.ArgumentParser()
### Positional
parser.add_argument('positional1')
parser.add_argument('positional2', help="positional argument 2")
parser.add_argument('positional3', help="positional argument 3 type int", type=int)
### Optional
parser.add_argument("--optional1", help="optional argument 1")
parser.add_argument("--optional2", help="optional argument 2", action="store_true")
@qpwo
qpwo / halting_proof.py
Created August 6, 2018 22:09
Python proof of undecidability of the halting problem
# Proof of undecidability of halting problem:
from Turing import will_halt
# will_halt(program, input) -> does_halt
def loop_forever(garbage_input):
return loop_forever(garbage_input)
def square_root(n):
return n ** 0.5
@mogproject
mogproject / PythonUnitTestCheatSheet.md
Created July 24, 2015 11:17
Python unittest Cheat Sheet

Python unittest Cheat Sheet

Skeleton

@LukeSmithxyz
LukeSmithxyz / urlview.md
Last active May 30, 2023 13:27
Following Terminal Links with URLview

Following Terminal Links with URLview

Link handling

Specify what you want urlview to open your links with in ~/.urlview after COMMAND. I.e. the line below will make urlview open all urls in Firefox.

COMMAND firefox
@nitaku
nitaku / README.md
Last active June 25, 2023 19:14
Hilbert spiral (L-system)

A Lindenmayer system that draws a sequence of growing Hilbert curves following a spiral layout.

Like in the previous experiment, a repetition rule is added to the Hilbert rules (A and B) to obtain the sequence. In order to produce the spiral layout, the rule contains some turns and different repetitions of the Hilbert rules A and B.

The objective is to find a layout that starts from a central point and grows spiraling away from it. The layout is intended to be used for creating a jigsaw treemap, so a naive spiral layout (like this one) is out of the question because of the elongated regions it would produce.

By leveraging the locality properties of the Hilbert curve, the layout presented in this example should somehow manage to both spiral away from a central point and have regions with good as

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
int main(int argc, char *argv[])
{
unsigned long value;
char *terminatedAt;
//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@candu
candu / lipsum
Created November 7, 2014 18:13
Command-line Lorem Ipsum generator using curl, lipsum.com, and jq
#!/bin/sh
AMOUNT=5
WHAT=paras
START=false
while getopts ":n:wpbls" opt; do
case $opt in
n)
AMOUNT=$OPTARG