Skip to content

Instantly share code, notes, and snippets.

View ninegrid's full-sized avatar

Daniel Jackson ninegrid

  • ⋮ ⋮ ⋮
  • 30.2669° N, 97.7428° W
View GitHub Profile
#!/bin/bash
# Copyright Matthew Bruenig <matthewbruenig@gmail.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#!/bin/bash
# Copyright Matthew Bruenig <matthewbruenig@gmail.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ninegrid
ninegrid / send-syslog.ps1
Created February 4, 2019 19:44
send syslog with powershell
Function Send-Syslog {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)] [string]$ServerName,
[Parameter(Mandatory=$false)] [string]$Severity = '1',
[Parameter(Mandatory=$false)] [string]$Facility = '22',
[Parameter(Mandatory=$false)] [string]$HostName = $env:COMPUTERNAME,
[Parameter(Mandatory=$false, ValueFromPipeline=$true)][string]$Message = 'From Powershell'
)
$Priority = ([int]$Facility * 8) + [int]$Severity
@ninegrid
ninegrid / bool.agda
Created March 6, 2018 04:17
some agda
{-# OPTIONS --universe-polymorphism #-}
module mybool where
-- http://www.cse.chalmers.se/~ulfn/code/tphols09/ ⟵ ../tphols09/
--------------------------------------------------------------------------------
-- data types
--------------------------------------------------------------------------------
data 𝔹 : Set where
+/(#~-.@(2&|)){."1@(]`(({:,+/)@])@.(>{:)^:(<_))&1 2 (4e6)
#time
(fun _ ->
let initial =
[for x = 0 to 100 do
for y = 0 to 100 do
if (1 < x) && (x < y) && ((x + y) < 100) then
yield (x,y)]
List.iter (fun _ -> ()) initial
)()
#time
(fun _ ->
let initial =
seq { for x = 0 to 100 do
for y = 0 to 100 do
if (1 < x) && (x < y) && ((x + y) < 100) then
yield (x,y) }
Seq.iter (fun _ -> ()) initial
)()
// Learn more about F# at http://fsharp.net
namespace BasicConcepts
module Algorithms =
let ``1.1E`` (m : uint32) (n : uint32) =
let rec aux m n l =
let r = m % n
if r <> 0u then aux n r (r :: l) else l
aux m n [] |> Seq.head

(* original sample data.. search/replaced symbols from python
dictionary of dictionaries *)
let criticsList = [
"Lisa Rose", [
"Lady in the Water", 2.5; "Snakes on a Plane", 3.5;
"Just My Luck", 3.0; "Superman Returns", 3.5;
"You; Me and Dupree", 2.5; "The Night Listener", 3.0
];
"Gene Seymour", [

#r @"E:\Assemblies\OpenTK\OpenTK.dll"
open System
open System.Drawing
open System.Collections.Generic
open OpenTK
open OpenTK.Graphics
open OpenTK.Graphics.OpenGL