Skip to content

Instantly share code, notes, and snippets.

View cirocorvino's full-sized avatar

Ciro Corvino cirocorvino

View GitHub Profile
@birgitta410
birgitta410 / gist:a8fcd71f04b2453dfbd26b3376ea9345
Created August 15, 2024 10:20
Experiment: Enzyme test migration with autogen
# Prerequisites:
# - pip install pyautogen
# - pip install python-dotenv
# - git clone git@github.com:openmrs/openmrs-react-components.git
# - .env file in the same directory with the respective env variables needed for the model connection
#
# Implementation based on https://microsoft.github.io/autogen/docs/notebooks/agentchat_function_call_code_writing/
# Prompt based on docs at https://testing-library.com/docs/react-testing-library/migrate-from-enzyme/
import os
@jonasraoni
jonasraoni / Flattener.cs
Created July 14, 2018 14:46
Flatten Array in C#
using System;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// Extends the Array with the Flatten method
/// </summary>
public static class Flattener {
/// <summary>
/// Given a N-dimensional array, flattens it into a new one-dimensional array without modifying the elements' order
@axelheer
axelheer / FakeDbSet.cs
Created February 27, 2015 18:54
Fake implementation of Entity Framework's DbSet for fast unit testing
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.SqlServer;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
@liabru
liabru / save-file-local.js
Created April 24, 2014 17:46
Save a text file locally with a filename, by triggering a download in JavaScript
/*
* Save a text file locally with a filename by triggering a download
*/
var text = "hello world",
blob = new Blob([text], { type: 'text/plain' }),
anchor = document.createElement('a');
anchor.download = "hello.txt";
anchor.href = (window.webkitURL || window.URL).createObjectURL(blob);