Skip to content

Instantly share code, notes, and snippets.

View revuel's full-sized avatar

M. Revuelta Espinosa revuel

View GitHub Profile
@revuel
revuel / clock.scad
Last active August 29, 2015 14:17 — forked from m-ou-se/clock.scad
$fs=1;
$fa=1;
servo_l = 24;
servo_w = 13;
servo_h = 21;
bolt_hole_diameter = 4.5;
servo_axis_diameter = 4;
@revuel
revuel / font
Last active August 29, 2015 14:17 — forked from m-ou-se/font
0
0 1.5
0 0.5
0.2 0.1
0.5 0
0.8 0.1
1 0.5
1 1.5
0.8 1.9
0.5 2
@revuel
revuel / font
Last active August 29, 2015 14:17 — forked from m-ou-se/font
0
0 1.5
0 0.5
0.2 0.1
0.5 0
0.8 0.1
1 0.5
1 1.5
0.8 1.9
0.5 2
@revuel
revuel / README-Template.md
Created April 3, 2017 07:55 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@revuel
revuel / jiracustomfieldoptstrim.groovy
Created July 25, 2018 15:54
Jira ScriptRunner, get rid of custom field options with unnecesary extra white spaces
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.customfields.manager.OptionsManager;
import com.atlassian.jira.issue.fields.config.FieldConfig;
import com.atlassian.jira.issue.context.IssueContextImpl;
import com.atlassian.jira.issue.customfields.manager.OptionsManager;
@revuel
revuel / random_time_report.py
Last active January 2, 2020 08:33
Generates random time intervals, for time reporting purposes...
""" Generates random time intervals """
import random
for x in range(30):
entry_h = random.randint(8, 10)
entry_m = random.randint(0, 59)
if entry_h == 10:
entry_m = 0
/* To get rid of the useless subscription block of the digital diary "20Minutes"
* Works as of July 2020
* Just copy and paste the follwoing code to the browser's console at 20minutes site
*/
function enableRead() {
// Allow scroll down
var body = document.getElementsByTagName("body")
body[0].setAttribute("style", "")
@revuel
revuel / playing_slots.py
Created September 20, 2020 11:57
Example of using slotting a POPO class overriding __setattr__ to do validations
""" Just playing around with slots (BASIC EXAMPLE Plain Old Python Object) """
import re
date_pattern = re.compile(r'(\d{4})[/.-](\d{2})[/.-](\d{2})$')
class Person(object):
""" Person sample class with slots """
__slots__ = ('name', 'dob')
@revuel
revuel / inmutable_class.py
Created September 20, 2020 16:35
Dummy example of immutable class in python
""" Dumb way to produce immutable instances in Python """
class ImmutablePerson(object):
""" ... """
__slots__ = ('name', 'dob')
def __init__(self, name: str, dob: str):
""" Only available at initialization """
@revuel
revuel / switch.py
Last active October 18, 2020 12:08
Dummy way to use switch like method in python 3
""" Switch example for python 3 """
def _say_hello() -> str:
return 'Hello'
def _say_goodbye() -> str:
return 'Good bye'