Skip to content

Instantly share code, notes, and snippets.

View Luiz-Monad's full-sized avatar
💭
computing

Luiz Luiz-Monad

💭
computing
View GitHub Profile
@Luiz-Monad
Luiz-Monad / AndroidNdkR22.props
Created March 1, 2021 19:37 — forked from jwtowner/AndroidNdkR22.props
Build with Android NDK r22 in MSVS 2019
<PropertyGroup Label="Globals">
<Keyword>Android</Keyword>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<ApplicationType>Android</ApplicationType>
<ApplicationTypeRevision>3.0</ApplicationTypeRevision>
<PlatformToolset>Clang_5_0</PlatformToolset>
<AndroidAPILevel Condition="'$(Platform)'=='ARM64'">android-21</AndroidAPILevel>
<AndroidAPILevel Condition="'$(Platform)'!='ARM64'">android-19</AndroidAPILevel>
<UseOfStl>c++_static</UseOfStl>
<ShowAndroidPathsVerbosity>Low</ShowAndroidPathsVerbosity>
@Luiz-Monad
Luiz-Monad / f_sharp_gist.txt
Created February 26, 2021 21:11
F# Learning Resources
F#
--
https://fable.io/
https://fsharpforfunandprofit.com/
https://fsharpforfunandprofit.com/fppatterns/
https://safe-stack.github.io/
https://www.compositional-it.com/consultancy/safe-stack/
http://okmij.org/ftp/ML/index.html
https://nostarch.com/fsharp
@Luiz-Monad
Luiz-Monad / sort-json.ps1
Last active February 26, 2021 20:12
sort json object by keys
function Sort-Json($json) {
$t = `
Get-Content $json -Encoding UTF8 | `
ConvertFrom-Json;
$tmp = New-Object -Type psobject;
$t.psobject.properties | `
Select-Object -Expand name | `
Sort-Object | `
ForEach-Object { $tmp | `
Add-Member -Type noteproperty -Name $_ -Value $t.$_
@Luiz-Monad
Luiz-Monad / webpack.config.js
Created February 23, 2021 06:22
webpack from hell
// Template for webpack.config.js in Fable projects
// Find latest version in https://github.com/fable-compiler/webpack-config-template
// In most cases, you'll only need to edit the CONFIG object (after dependencies)
// See below if you need better fine-tuning of Webpack options
// Dependencies. Also required: core-js, fable-loader, fable-compiler, @babel/core, @babel/preset-env, babel-loader
const webpack = require('webpack');
//const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const HtmlWebpackPlugin = require('html-webpack-plugin');
@Luiz-Monad
Luiz-Monad / qdft.md
Last active January 17, 2021 17:32
Quantum DFT
@Luiz-Monad
Luiz-Monad / timemachine.fs
Created January 12, 2021 05:29
timemachine.fs
type AsyncResultBuilder ( timeMachine ) =
let mutable map = emptyMap ()
let mkOperation generator =
let intercept = generator ()
let cmds = side_effect_connection_ctx ()
let cmdList = sql_to_send cmds
@Luiz-Monad
Luiz-Monad / cecil.fs
Created January 6, 2021 18:46
IL emit with cecil
// mono.cecil
//let definition = AssemblyNameDefinition ( assemblyName, new Version(1, 0) )
//let assembly = AssemblyDefinition.CreateAssembly ( definition , moduleName, ModuleKind.Dll )
//let mainModule = assembly.MainModule
let definition = AssemblyName ()
definition.Name <- assemblyName
definition.Version <- new Version(1, 0)
let assembly = AssemblyBuilder.DefineDynamicAssembly( definition, AssemblyBuilderAccess.Run)
let mainModule = assembly.DefineDynamicModule ( moduleName )
//let importedBaseType = mainModule.Import(actualBaseType)
@Luiz-Monad
Luiz-Monad / traverse_ShapeCombination_expr.fs
Created December 31, 2020 16:20
failed try on structural automapping
open System
open System.Reflection
open System.Collections
open Microsoft.FSharp.Reflection
open Microsoft.FSharp.Quotations
open Microsoft.FSharp.Quotations.ExprShape
open Microsoft.FSharp.Quotations.DerivedPatterns
let dump tag s = (string s).Dump(string tag); s
@Luiz-Monad
Luiz-Monad / eq.fs
Created December 22, 2020 22:03
FSharp custom equality overload
type Equality =
static member inline Mk = Unchecked.defaultof<Equality>
static member inline Eq (x: T1, y: T1) = (x.String = y.String)
static member inline Eq (x: T2, y: T2) = (x.Array = y.Array)
let inline liftEquals (c: ^C) x y =
let inline call (_: ^C, x: ^X, y: ^Y) =
((^C or ^X or ^Y): (static member Eq: 'X * 'Y -> bool) (x, y))
call (c, x, y)
@Luiz-Monad
Luiz-Monad / query_selector.fs
Last active July 21, 2020 13:15
graphql-less query creator
namespace Controller.Selector
open System
open log4net
open System.Linq
open System.Web.Http
open Microsoft.FSharp.Linq
open Microsoft.FSharp.Quotations
open Backend.Helpers