Skip to content

Instantly share code, notes, and snippets.

View mlebkowski's full-sized avatar
🤷‍♀️

Maciej Łebkowski mlebkowski

🤷‍♀️
View GitHub Profile
@Avaq
Avaq / combinators.js
Last active March 18, 2024 20:49
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@robotlolita
robotlolita / loops-are-evil.md
Last active March 2, 2022 17:19
Why `xs.each(f)` should not be considered a "loop".

First and foremost, let's take a look at the following pieces of code. The first one is something you should be rather familiar with, and the second one is also a somewhat familiar idiom these days (at least in languages with higher-order functions):

// Example 1:
30 + 12

// Example 2:
xs.map(f)
@rtomayko
rtomayko / testlib.sh
Last active April 29, 2022 07:23
Simple shell command language test library.
#!/bin/sh
# Usage: . testlib.sh
# Simple shell command language test library.
#
# Tests must follow the basic form:
#
# begin_test "the thing"
# (
# set -e
# echo "hello"
@mlebkowski
mlebkowski / build.xml
Created September 10, 2012 10:44
Default Ant File
<?xml version="1.0" encoding="UTF-8"?>
<project name="Your Project Name" default="build">
<target name="build" depends="prepare,phpunit" />
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build/api" />
<delete dir="${basedir}/build/code-browser" />
<delete dir="${basedir}/build/coverage" />
<delete dir="${basedir}/build/logs" />
@bjhess
bjhess / pull_request_webhook.md
Created May 18, 2012 15:58
The way I had to add a github repo webhook for pull requests

This is more complex than necessary.

GitHub webhooks for a URL by default only fire on repo pushes. There appears to be no way in the web UI to set up webhooks for other events. And so we go to the API. I prefer to do this type of thing with Hurl.

{
  "name": "web",
 "active": true,
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.