Skip to content

Instantly share code, notes, and snippets.

View marcoacierno's full-sized avatar
👀
I know you're blind man, but you gotta see this

Marco Acierno marcoacierno

👀
I know you're blind man, but you gotta see this
View GitHub Profile
@marcoacierno
marcoacierno / xstate-tests.ts
Created February 10, 2023 00:43
XState tests example
import { waitFor } from "xstate/lib/waitFor";
import { interpret } from "xstate";
describe("Example", () => {
it("answering with the wrong shells loses the turn", async () => {
const mockGameMachine = gameMachine.withConfig({
actions: {
redirectToGame: jest.fn(),
},
services: {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marcoacierno
marcoacierno / script.py
Created February 6, 2019 14:23
python pizza badge psd to pdf
import glob
import subprocess
for f in glob.glob('./*.psd'):
fname = f[2:]
fname = fname[:-4]
print('call:', 'convert "' + f + '"[0] "./exported/' + fname + '.pdf"')
subprocess.call('convert "' + f + '"[0] "./exported/' + fname + '.pdf"', shell=True)
# print('f ->', f, 'fname', fname)
@marcoacierno
marcoacierno / moving.py
Created March 24, 2018 19:01
move images from digitalocean spaces to s3
import boto3
import io
import sys
session = boto3.session.Session()
do_client = session.client('s3',
region_name='nyc3',
endpoint_url='https://nyc3.digitaloceanspaces.com',
aws_access_key_id='',
[
{
name: "hello"
},
{
name: "ciao",
}
]
@marcoacierno
marcoacierno / gist:62d526267e6e50465ce94166c471a673
Last active April 8, 2017 13:07
Dinner Sat 8 Apr alternatives
Trattoria Da Guido,
Via Faenza, Florence
(055 264 5741)
https://goo.gl/maps/wZbZwSyduiB2
---
All'Antico Vinaio,
{
"devices":[
{
"id":"Y3mK5Kvy",
"device_id":"did_e3be5",
"device_type":"ios"
},
{
"id":"6ZvpDPvX",
"device_id":"did_84fdd",
@marcoacierno
marcoacierno / Main.java
Last active August 29, 2015 14:20
Extra verbs from italian-verbs.it
package com.estraiverbi;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import java.io.BufferedReader;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.net.URISyntaxException;
@marcoacierno
marcoacierno / real_files_and_merge.py
Last active August 29, 2015 14:19
Python - Read all files and merge them in one file -- First argument: folder start. Second arguments: folders to ignore (use ,)
from genericpath import exists
import os
from os.path import relpath, dirname
__author__ = 'Marco A.'
import sys
if __name__ == "__main__":
arguments_length = len(sys.argv) - 1
@marcoacierno
marcoacierno / Main.java
Last active August 29, 2015 14:10
IntellIJ IDEA Theme downloader
package com.besaba.revonline.themesdownloader;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPathExpressionException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;