Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View xeBuz's full-sized avatar
🧉
Converting mate into technical debts

Jesús Roldán xeBuz

🧉
Converting mate into technical debts
View GitHub Profile
@xeBuz
xeBuz / machine.js
Created May 30, 2023 13:16
Generated by XState Viz: https://xstate.js.org/viz
// Define the state machine
const stateMachine = Machine({
id: 'projectIdeasOnBenevityStateMachine',
initial: 'new',
states: {
new: {
on: {
CENSORED: 'censored',
DRAFT: 'draft',
@xeBuz
xeBuz / machine.js
Created May 9, 2022 11:34
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'submission-state-machine',
initial: 'draft',
context: {},
states: {
draft: {
on: {
SUBMIT: { target: 'preModeration' },
@xeBuz
xeBuz / machine.js
Created May 9, 2022 07:59
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'submission-state-machine',
initial: 'draft',
context: {},
states: {
draft: {
on: {
SUBMIT: { target: 'preModeration' },
DELETE: { target: 'deleted' },
@xeBuz
xeBuz / template.md
Last active June 15, 2017 15:03
PR Template

What does this Pull Request Do?

How should this be manually tested?

Any background context you want to provide?

@xeBuz
xeBuz / csvtodict.py
Created February 5, 2015 20:45
Convert a CSV to a PHP key-value fields
import csv
import os
import argparse
parser = argparse.ArgumentParser(description='Convert CSV Columns to a PHP KeyValue array')
parser.add_argument('-f', '--file', action='store', dest='file', default='exampe.csv', help="CSV file. Default: exmple.csv")
parser.add_argument('-k', '--key', action='store', dest='column_key', default='0', help="Key Column Number")
parser.add_argument('-v', '--value', action='store', dest='column_value', default='1', help="Value Column Number")
args = parser.parse_args()
var PlayerGravity = function (game, x, y) {
this.game = game;
this.speed = 5;
Phaser.Sprite.call(this, this.game, this.game.world.randomX, 10, 'chocobo');
game.physics.enable( [ this ], Phaser.Physics.ARCADE);
this.body.collideWorldBounds = true;
this.body.bounce.y = 0.8;
};
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@xeBuz
xeBuz / playcounts.py
Last active February 13, 2018 13:28
Get artists and tracks w/playcounts form Lastfm user.
#!/usr/bin/python2
# -*- coding: utf-8 -*-
import pylast
api_key = '189c5354198342a01be847e595afbb14'
username = 'eikiu'
api = pylast.LastFMNetwork(api_key = api_key)
user = pylast.User(username, api)
library = user.get_library()
@xeBuz
xeBuz / console2gif.sh
Created October 18, 2012 01:48
Convert the console to a gif for n seconds
#!/bin/bash
clear
mkdir temp_gif
segs=`expr $1 \* 5`
for (( i = 1; i <= $segs ; i++ ));
do
printf -v number "%06d" $i
import -window $WINDOWID temp_gif/$number.gif
@xeBuz
xeBuz / marilyn.py
Created September 25, 2012 04:01
Ejercicio
#!/usr/bin/python2
# -*- coding: utf-8 -*-
a = ['A1', 'A2', 'A3', 'A4']
b = ['B1', 'B2', 'B3']
c = ['C1', 'C2']
d = []
for i in a: