Skip to content

Instantly share code, notes, and snippets.

View marcingolenia's full-sized avatar
🎯
Focusing

marcingolenia

🎯
Focusing
View GitHub Profile
typedef struct {
char fileName[1000];
int array[1000];
size_t used;
size_t size;
} FileFindings;
//jakiś tam kod...
int main( int argc, char ** argv )
/*eslint-disable no-var*/
var path = require('path');
var AureliaWebpackPlugin = require('aurelia-webpack-plugin');
var ProvidePlugin = require('webpack/lib/ProvidePlugin');
module.exports = {
resolve: {
extensions: ['', '.js', '.ts']
},
@marcingolenia
marcingolenia / git.migrate
Created February 21, 2019 15:29 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
public class OrSpecification<T> : Specification<T>
{
private readonly Specification<T> _left;
private readonly Specification<T> _right;
public OrSpecification(Specification<T> left, Specification<T> right)
{
_right = right;
_left = left;
}
namespace Invoicing.BehaviourTests
{
using TestStack.BDDfy;
using Xunit;
public class UnitTest1
{
private decimal _result;
private decimal _value1;
private decimal _value2;
@marcingolenia
marcingolenia / FSharpAsyncExtension.cs
Last active June 18, 2020 13:21
FSharpCSharpInteroperability
namespace Api.CompositionRoot
{
using System.Threading;
using System.Threading.Tasks;
using Microsoft.FSharp.Control;
using Microsoft.FSharp.Core;
public static class FSharpAsyncExtension
{
public static Task<T> StartAsDefaultTask<T>(this FSharpAsync<T> computation) =>
@marcingolenia
marcingolenia / DapperFSharp.fs
Created June 14, 2020 17:45
FSharpDapperWrapper
namespace FSharpDapperWrapper
open System.Data
module DapperFSharp =
open System.Data.SqlClient
open Dapper
let dbQuery<'Result> (query: string) (connection: SqlConnection): Async<'Result seq> =
connection.QueryAsync<'Result>(query) |> Async.AwaitTask
@marcingolenia
marcingolenia / Dockerfile
Last active October 12, 2021 09:53
Just place the script in a folder with sql files. Optionally use docker as well :)
FROM mcr.microsoft.com/dotnet/sdk:5.0
COPY * ./
CMD ["sh", "-c", "dotnet fsi migrateDatabase.fsx \"${DB_CONNECTION}\""]
module SupportOperations.TestApi
open System.Net.Http
open Microsoft.AspNetCore.Mvc.Testing
open Newtonsoft.Json
open System
open FsToolkit.ErrorHandling
open Program
let create () = (new WebApplicationFactory<Program>()).Server
@marcingolenia
marcingolenia / Dockerfile
Last active January 19, 2022 08:43
Neo4j in docker
FROM neo4j:latest
COPY neo_import.sh neo_import.sh
COPY *.cypher .
RUN ["chmod", "+x", "neo_import.sh"]
ENTRYPOINT ["./neo_import.sh"]