Skip to content

Instantly share code, notes, and snippets.

@JacobLeach
JacobLeach / amcrest.pm
Created December 28, 2017 13:42
Zoneminder PTZ Control Script for Amcrest Cameras
# ==========================================================================
#
# ZoneMinder Acrest 781 IP Control Protocol Module, 20160101, Rev2
# Changes from Rev1:
# Fixed installation instructions text, no changes to functionality.
# Copyright (C) 2016 Herndon Elliott
# alabamatoy at gmail dot com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
export PS1=$'\A \[\033[00;31m\]\H\[\033[00m\033[00;34m\] \W\[\033[00m\033[00;32m\]$(__git_ps1)\[\033[00m\] \xce\xbb '
{
"swagger": "2.0",
"info": {
"version": "",
"title": ""
},
"paths": {
"/api/videos": {
"get": {
"produces": ["application/json;charset=utf-8"],
### Keybase proof
I hereby claim:
* I am jacobleach on github.
* I am jacobleach (https://keybase.io/jacobleach) on keybase.
* I have a public key whose fingerprint is 1571 1D0A A0FC EE06 5AC0 9222 4FD9 301A B6E5 3381
To claim this, I am signing this object:
bmiTell :: (RealFloat a) => a -> a -> String
bmiTell weight height
| bmi <= 18.5 = "You're underweight, you emo, you!"
| bmi <= 25.0 = "You're supposedly normal. Pffft, I bet you're ugly!"
| bmi <= 30.0 = "You're fat! Lose some weight, fatty!"
| otherwise = "You're a whale, congratulations!"
where bmi = weight / height ^ 2
public class Test
{
public static void main(String[] args)
{
Parent a = new Parent();
Child b = new Child();
a.hello();
b.hello();
Finished frequencies
Char: Null, Frequency: 22
Char: Null, Frequency: 10
Char: a, Frequency: 5
Char: b, Frequency: 5
Char: Null, Frequency: 12
Char: z, Frequency: 5
@JacobLeach
JacobLeach / SimpleExpressionParsing.hs
Last active August 29, 2015 13:57
Simple Expression Parser
{-# LANGUAGE OverloadedStrings #-}
import Control.Applicative ((<|>))
import Data.Attoparsec.Text
import System.Environment
import Data.Text
data Expression = Expression Int Op Expression |
Value Int
deriving (Show)
{-# LANGUAGE OverloadedStrings #-}
import Data.Attoparsec.Char8
import Data.Attoparsec.ByteString.Char8
import Data.Word
import Control.Applicative
data IP = IP Int Int Int Int deriving (Show)
parseIP :: Parser IP
{-# LANGUAGE OverloadedStrings #-}
import Data.Attoparsec.Char8
import Data.Word
import Control.Applicative
data IP = IP Int Int Int Int deriving (Show)
parseIP :: Parser IP
parseIP = do