Skip to content

Instantly share code, notes, and snippets.

View AkosLukacs's full-sized avatar

Ákos Lukács AkosLukacs

View GitHub Profile
@AkosLukacs
AkosLukacs / Index.fs
Created August 7, 2018 05:48
Set up MiniProfiler - index page with the profiler UI bits
module Views
open Giraffe
open GiraffeViewEngine
open Microsoft.AspNetCore.Http
open StackExchange.Profiling
let index (ctx: HttpContext) =
// Just render the includes
let mp = MiniProfiler.Current.RenderIncludes(ctx)
@AkosLukacs
AkosLukacs / SetUpMiniProfiler.fs
Created August 7, 2018 05:27
Configure miniprofiler in a Giraffe app
let configureApp (app : IApplicationBuilder) =
app.UseDefaultFiles()
.UseStaticFiles()
// this line
.UseMiniProfiler()
.UseGiraffe webApp
let configureServices (services : IServiceCollection) =
services.AddGiraffe() |> ignore
@AkosLukacs
AkosLukacs / espruino-dht22-thingspeak-hack.js
Created January 3, 2016 13:53
espruino-dht22-thingspeak-hack
var miez = "dht22-send-to-thingspeak";
var httpLib = require("http");
var dht22Lib = require("DHT22");
function readDht22(pin, cb){
console.log('trying connect to dht22@', pin);
var dhtConn = dht22Lib.connect(pin);
dhtConn.read(function (a) {
console.log('Temp @', pin, ' is '+a.temp.toString()+' and RH is '+a.rh.toString());
@AkosLukacs
AkosLukacs / ExampleOutput.sql
Created July 8, 2012 22:06
Create drop+create scripts for MS SQL stored procedures and views in a given database using PowerShell and SMO
-- * * * * 2012.07.09. 0:13:16, server:'xxxx', db:'xxxx', search:'A_exampl' * * * *
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[A_example]') AND type in (N'P', N'PC')) --#1
Drop procedure [dbo].[A_example];
GO
-- * * * * BODY * * * *
-- * * * * #1:A_example; CreateDate:2012.07.09. 0:13:04, DateLastModified:2012.07.09. 0:13:04 * * * *
GO
-- =============================================
-- Author: Akos