I hereby claim:
- I am sebfia on github.
- I am sebfia (https://keybase.io/sebfia) on keybase.
- I have a public key whose fingerprint is 2085 D96D 53C4 AACB 0017 A34C ED7A C095 7459 87B2
To claim this, I am signing this object:
/// <summary> | |
/// A web client implementation that extends the System.Net.WebClient by storing cookies for recurring requests. | |
/// </summary> | |
public sealed class ExtendedWebClient : WebClient | |
{ | |
public CookieContainer CookieContainer { get; set; } | |
protected override WebRequest GetWebRequest(Uri address) | |
{ | |
var webRequest = base.GetWebRequest(address); |
I hereby claim:
To claim this, I am signing this object:
let (|Int|_|) str = | |
match Int32.TryParse(str) with | |
| (true,int) -> Some int | |
| _ -> None | |
let (|Bool|_|) str = | |
match Boolean.TryParse(str) with | |
| (true,bool) -> Some bool | |
| _ -> None |
#/bin/bash | |
domain="sebfia.net" | |
ipAddress="" | |
years=1 | |
days=365 | |
printip="127.0.0.1" | |
writeip="IP:127.0.0.1" | |
pwd="" | |
read -p "Enter the domain for your server certificate: [$domain] >" response | |
if [[ $response != "" ]]; then |
function sha1(msg) | |
{ | |
function rotl(n,s) { return n<<s|n>>>32-s; }; | |
function tohex(i) { for(var h="", s=28;;s-=4) { h+=(i>>>s&0xf).toString(16); if(!s) return h; } }; | |
var H0=0x67452301, H1=0xEFCDAB89, H2=0x98BADCFE, H3=0x10325476, H4=0xC3D2E1F0, M=0x0ffffffff; | |
var i, t, W=new Array(80), ml=msg.length, wa=new Array(); | |
msg += fcc(0x80); | |
while(msg.length%4) msg+=fcc(0); | |
for(i=0;i<msg.length;i+=4) wa.push(msg.cca(i)<<24|msg.cca(i+1)<<16|msg.cca(i+2)<<8|msg.cca(i+3)); | |
while(wa.length%16!=14) wa.push(0); |
module JsonWebToken = | |
open System | |
open System.Text | |
open System.Text.RegularExpressions | |
open System.Security.Cryptography | |
let replace (oldVal: string) (newVal: string) = fun (s: string) -> s.Replace(oldVal, newVal) | |
let minify = | |
let regex = Regex("(\"(?:[^\"\\\\]|\\\\.)*\")|\\s+", RegexOptions.Compiled|||RegexOptions.CultureInvariant) | |
fun s -> | |
regex.Replace(s, "$1") |
//package Microsoft.Extensions.Configuration | |
open Microsoft.Extensions.Configuration | |
let config = | |
ConfigurationBuilder() | |
.SetBasePath(context.FunctionAppDirectory) | |
.AddJsonFile("local.settings.json", true, true) | |
.AddEnvironmentVariables() | |
.Build() | |
let storageKey = config.["AzureWebJobsStorage"] |
//package Microsoft.WindowsAzure.Storage | |
open Microsoft.WindowsAzure.Storage | |
let getBlobsInDirectory storageKey containerName = | |
let acct = CloudStorageAccount.Parse(storageKey) | |
let client = acct.CreateCloudBlobClient() | |
let container = client.GetContainerReference(containerName) | |
let rec getBlobs (d: string) t blobs = | |
async { | |
let! response = container.ListBlobsSegmentedAsync(d,true,BlobListingDetails.None,Nullable<int>(20),t,null,null) |> Async.AwaitTask | |
let result = response.Results |> Seq.map (fun i -> i :?> CloudBlockBlob) |> Seq.fold (fun s y -> y::s) blobs |
module Async | |
open System.Threading.Tasks | |
let ForEach<'T> (computations: Async<'T> list) = | |
let rec forEach l r = | |
async { | |
match l with | |
| f::t -> | |
let! x = f | |
return! x::r |> forEach t | |
| [] -> return r |> List.rev |