Skip to content

Instantly share code, notes, and snippets.

@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()
@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 / 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 / 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 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',