Skip to content

Instantly share code, notes, and snippets.

About

I came up with these exercises for someone learning to code. But I thought more people might want to do them.

I like functional programming, so the exercises asks you to make functions that are common in functional programming. If you have learned a language, but want to learn more about functional programming, these exercises are for you.

The exercises were originally meant for Python, but doing them in JavaScript, Ruby or any Lisp (Scheme, Clojure, …) should work just as well. It should also be possible to do them in Java and C#, but it will probably not be as easy.

Most of the functions you are asked to create already exist in functional languages, or libraries for most languages. But it can be educational to implement them yourself.

@h3lls
h3lls / config.yml
Last active January 6, 2018 09:42
Make sure you also run: pip install python-binance and pip install flask for the web version
livecoin:
enabled: False
apikey: LIVECOINAPIKEY
sign: LIVECOINSIG
max_bid: 0.00011
poloniex:
enabled: False
apikey: POLONIEXAPIKEY
sign: POLONIEXSIG
binance:
@westmark
westmark / auth0-verify.js
Last active August 18, 2022 07:45
Auth0 JWT Verification
/**
The MIT License (MIT)
Copyright (c) 2017 Fredrik Westmark
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@shaiguitar
shaiguitar / gist:627d52ebc0c03af488477b5d636a8909
Created August 31, 2017 22:27
Using docker compose to mount current working directory dynamically into the container
# mount volume PWD on host to /app in container.
shai@lappy ~/tmp/example-working-docker-compose-environment-vars [master *] ± % cat docker-compose.yml
version: "3"
services:
some_server:
...
volumes:
- $PWD:/app
@ruben2020
ruben2020 / kbd_backlight_ctrl.py
Last active August 5, 2023 22:27
Keyboard Backlight Control Service (Python script) that works on Arch Linux
#!/usr/bin/python
import struct
import time
import sys
import dbus
from threading import Thread, Lock
# Copy this file to /usr/bin as root
# Change permissions of this file to 754
# This file in /usr/bin should be owned by root, group is root
@romuald
romuald / gist:0346c76cfbbbceb3e4d1
Created April 30, 2015 16:05
Sub-millisecond profiling for python pstats
# -*- coding: utf8 -*-
"""
A simple monkeypath for the pstats module to be able to see sub-millisecond timings
If display value is 0.000, display the time in microseconds
"""
import pstats
def f8(x):
@140am
140am / ipc_test.py
Last active June 26, 2023 14:46
Simple Python / ØMQ IPC (Inter Process Communication) performance benchmark
""" Simple IPC benchmark test
Test throughput of 512 KB messages sent between two python processes using:
- multiprocessing pipe
- zeroMQ PUSH/PULL
- zeroMQ DEALER/DEALER
Result:
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 7, 2024 17:48
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 7, 2024 17:37
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@mitchwongho
mitchwongho / Docker
Last active November 29, 2023 06:36
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash