Skip to content

Instantly share code, notes, and snippets.

@BusFactor1Inc
BusFactor1Inc / scheme-coin.lisp
Created December 16, 2017 07:28
A Common Lisp Blockchain - Scheme Coin
;;
;; scheme coin - a common lisp blockchain
;;
;; Burton Samograd
;; 2017
(load "~/quicklisp/setup.lisp")
(defconstant *coin-name* "Scheme Coin")
@chrisdone
chrisdone / Printf.idr
Last active December 8, 2023 00:02
Type-safe dependently-typed printf in Idris
module Printf
%default total
-- Formatting AST.
data Format
= FInt Format
| FString Format
| FOther Char Format
| FEnd
@mowings
mowings / readme.md
Last active April 9, 2024 20:51
ffmpeg stream and save video from Dahua 4300s IP Camera

Use ffmpeg to stream video from a dahua 4300s to a file or files

You can use ffmpeg to directly pull frames off of a dahua 4300s at full resolution. May be a good alternative to pricey dvrs which likely cannot record at full resolution, may not work with the camera, or are prohibitevly expensive

Simple Stream to file

Simple stream to file. Full resolution

ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:admin@198.175.207.61:554/live" \

-c copy -map 0 foo.mp4

@ghl3
ghl3 / _ImmutableDatabase
Last active March 21, 2023 14:07
Implementation of an immutable database in postgres
We couldn’t find that file to show.
@geraldvillorente
geraldvillorente / sitemap-crawler.php
Last active September 11, 2023 10:51
Sitemap crawler to test 301 and 404.
/**
* Crawl the sitemap.xml for 301 redirections and 404 errors.
* Source: http://edmondscommerce.github.io/php/crawl-an-xml-sitemap-quality-check-301-and-404.html
*
* To use this script you need to allocate a huge amount of time to maximum_execution_time to
* avoid Fatal error: Maximum execution time...I suggest to run this script on terminal.
* Ex: $ php test-xml.php > ~/Desktop/sitemap-curl-result.txt
*
* For 3000 links the average time the script consumed is around 45 minutes to 1 hour.
*/
@back2dos
back2dos / ClassList.hx
Last active September 3, 2023 12:18
Store all class names for runtime use.
package ;
#if macro
import haxe.macro.Context.*;
using haxe.macro.Tools;
#end
class ClassList {
static var NAME = 'ClassList';//must be the fully qualified name of this class
macro static function build() {
@maxivak
maxivak / 00. tutorial.md
Last active April 12, 2024 05:42
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
@AndrasKovacs
AndrasKovacs / Perm.agda
Last active April 5, 2020 09:56
Permutation relation in Agda. In the indiuctive definition we have insertions on both sides, as opposed to one side. This makes the transitivity proof *horrible* (or at least I couldn't do better).
open import Data.List
open import Data.Nat
open import Relation.Binary.PropositionalEquality
open import Function
open import Data.Product
open import Data.Sum
data _▶_≡_ {A : Set}(x : A) : List A → List A → Set where
here : ∀ {xs} → x ▶ xs ≡ (x ∷ xs)
@AndrasKovacs
AndrasKovacs / WellTyped.hs
Last active August 24, 2023 10:48
Well-typed interpreter from the Idris tutorial (http://eb.host.cs.st-andrews.ac.uk/writings/idris-tutorial.pdf) in Haskell.
{-# LANGUAGE
LambdaCase, GADTs, TypeOperators, TypeFamilies, DataKinds #-}
data Type = TInt | TBool | Type :=> Type
-- Needs GHC >= 7.8
type family Interp (t :: Type) where
Interp TInt = Int
Interp TBool = Bool
Interp (a :=> b) = Interp a -> Interp b
@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now