Skip to content

Instantly share code, notes, and snippets.

darkf

  • Zero page
Block or report user

Report or block darkf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kreed131
kreed131 / C8Client2.hs
Created Jul 22, 2011
Simple TCP client on Haskell
View C8Client2.hs
---
-- kreed131.blogspot.com/2011/07/tcp.html
---
import Network.Socket hiding (send, sendTo, recv, recvFrom)
import Network.Socket.ByteString (send, recv)
import qualified Data.ByteString.Char8 as B8
import System.Environment (getArgs)
View possum.hs
import Prelude hiding (toInteger)
import Data.List
data Value = StringValue String
| IntegerValue Integer
| NameValue String
| FuncValue [String] AST
| NilValue
deriving Show
@gre
gre / easing.js
Last active Oct 22, 2019
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
View easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@maxcountryman
maxcountryman / bf.c
Created Jan 29, 2012
A simple brainfuck interpreter in C
View bf.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// initialize the tape with 30,000 zeroes
unsigned char tape[30000] = {0};
// set the pointer to point at the left-most cell of the tape
unsigned char* ptr = tape;
@fiorix
fiorix / tcp-proxy.py
Created Feb 21, 2012
twisted tcp proxy
View tcp-proxy.py
#!/usr/bin/env python
# coding: utf-8
# http://musta.sh/2012-03-04/twisted-tcp-proxy.html
import sys
from twisted.internet import defer
from twisted.internet import protocol
from twisted.internet import reactor
from twisted.python import log
View gist:2921431
type nat = Zero | Succ of nat
let rec int_of_nat x =
match x with
| Zero -> 0
| Succ x' -> 1 + int_of_nat x'
let rec nat_of_int x =
match x with
| 0 -> Zero
@washort
washort / tutorial.rst
Created Aug 18, 2012
parsley tutorial
View tutorial.rst

Parsley Tutorial

From Regular Expressions To Grammars

Parsley is a pattern matching and parsing tool for Python programmers.

@quchen
quchen / trolling_haskell
Last active Oct 13, 2019
Trolling #haskell
View 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
View Graph.hs
-- | Some functions on directed graphs.
module Language.Coatl.Graph where
-- base
import Data.Maybe
-- containers
import Data.Map (Map)
import qualified Data.Map as M
import Data.Set (Set)
import qualified Data.Set as S
-- mtl
@jameshfisher
jameshfisher / halting_problem_javascript.md
Last active Sep 7, 2017
A proof that the Halting problem is undecidable, using JavaScript and examples
View halting_problem_javascript.md

Having read a few proofs that the halting problem is undecidable, I found that they were quite inaccessible, or that they glossed over important details. To counter this, I've attempted to re-hash the proof using a familiar language, JavaScript, with numerous examples along the way.

This famous proof tells us that there is no general method to determine whether a program will finish running. To illustrate this, we can consider programs as JavaScript function calls, and ask whether it is possible to write a JavaScript function which will tell us

You can’t perform that action at this time.