Skip to content

Instantly share code, notes, and snippets.

View jfischoff's full-sized avatar
™️
Jonathaning

Jonathan Fischoff jfischoff

™️
Jonathaning
View GitHub Profile
@jb55
jb55 / RPS.hs
Created July 6, 2012 18:45
teaching a friend Haskell with a nice game of rock paper scissors
import Control.Monad
import Control.Monad.Random
data RPS = Rock | Paper | Scissors
deriving (Show, Eq, Read)
data Result = Win | Lose | Tie
deriving (Show, Eq)
@sjoerdvisscher
sjoerdvisscher / Poly.hs
Created July 11, 2012 22:15
Converting Conor McBride's Polynomial datatype to raising/falling factorial base.
{-# LANGUAGE FlexibleInstances, DeriveFunctor #-}
import Control.Applicative
import Data.Unfolder
import Data.Unfoldable
import Data.Ratio
import Test.QuickCheck hiding (choose)
class Polynomial p where
@sjoerdvisscher
sjoerdvisscher / 1d
Created August 11, 2012 11:16
A total map as a zipper of an infinite perfect binary tree
-1 0 1 2 3 4 5
\ / \\/ \ / \ /
\ // \ /
\ // \ /
\\ /
\\ /
\\ /
\\/
//
//
@dmalikov
dmalikov / README.markdown
Last active May 31, 2019 06:31
Nix / NixOS links

Various blog posts related to Nix and NixOS


General

@HeinrichApfelmus
HeinrichApfelmus / GameLoop.hs
Created October 2, 2012 16:49
Game loop in reactive-banana
{------------------------------------------------------------------------------
reactive-banana
Implementation of an "industry strength" game loop with fixed time step
and variable fps.
See also http://gafferongames.com/game-physics/fix-your-timestep/
-------------------------------------------------------------------------------}
{-# LANGUAGE NoMonomorphismRestriction #-}
module Main where
@domenkozar
domenkozar / README.md
Created June 23, 2020 08:18
Haskell + GitHub Actions + Cachix
@ghostbar
ghostbar / loggly.service
Created March 26, 2015 22:57
loggly.service
[Unit]
Description=Loggly Forwarder
[Service]
ExecStart=/bin/sh -c "journalctl -o short -f | awk '{ print \"\<34\>1\", $0; fflush(); }' | awk '{ print $0, \"[your-consumer-token-from-loggly@41058 tag='deis']\" }' | ncat --ssl logs-01.loggly.com 6514"
[Install]
WantedBy=multi-user.target
[X-Fleet]
@mtigas
mtigas / README.md
Last active December 16, 2022 02:12
this is the nginx config for https://mike.tig.as/, with config to avoid the BEAST exploit (by using TLS 1.2+ ciphers or RC4) and enable SSL perfect forward secrecy (by preferring ECDHE ciphers)

[mike.tig.as][mta] server configuration

This gist contains the nginx and tor configurations for the [mike.tig.as][mta] servers, mainly to show:

  • Use of the chris-lea/nginx-devel PPA to allow use of SPDY.
  • ssl_ciphers selection to mitigate BEAST attack, enable [perfect forward secrecy][pfs] if possible and select the strongest possible ciphers within those bounds. (Exception is made for several ciphers at the end of list, for compatibility reasons.)
@NicolasT
NicolasT / paxos.rst.lhs
Created December 7, 2012 22:29
Basic Paxos in Haskell
> module Paxos.Basic where
> import Data.List (maximumBy)
> import Data.Maybe (catMaybes)
Phase 1a: Prepare
=================
A Proposer (the leader) creates a proposal identified with a number N. This
number must be greater than any previous proposal number used by this Proposer.
Then, it sends a Prepare message containing this proposal to a Quorum o
@Helw150
Helw150 / parallel_t5.py
Last active May 10, 2023 14:52
Flan T5 Parallel Usage
from transformers import AutoTokenizer, T5ForConditionalGeneration
# Model Init
n_gpu = 8
tokenizer = AutoTokenizer.from_pretrained("google/flan-ul2")
model = T5ForConditionalGeneration.from_pretrained("google/flan-ul2")
heads_per_gpu = len(model.encoder.block) // n_gpu
device_map = {
gpu: list(
range(