Skip to content

Instantly share code, notes, and snippets.

View colatkinson's full-sized avatar
👽
ayy lmao

Colin Atkinson colatkinson

👽
ayy lmao
View GitHub Profile
@carloscm
carloscm / testarrows.scm
Created April 7, 2015 21:49
-> ->> -<> -<>> for S7 Scheme
; -> ->> -<> -<>> for S7 Scheme
; inspired by https://github.com/nightfly19/cl-arrows and https://github.com/rplevy/swiss-arrows
(require stuff.scm)
; using: any? while
; replace those with your favorite scheme alternatives
; direct translation from https://github.com/nightfly19/cl-arrows
(define (arrow-proto handler initial-form forms)
(let ((output-form initial-form)
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active May 20, 2024 11:27
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@ssbarnea
ssbarnea / test_ansi.py
Created October 26, 2011 16:18
ANSI support detection code for Python.
#!/usr/bin/env python
import sys, os, time, platform
sample_ansi = '\x1b[31mRED' + '\x1b[33mYELLOW' + '\x1b[32mGREEN' + '\x1b[35mPINK' + '\x1b[0m' + '\n'
for handle in [sys.stdout, sys.stderr]:
if (hasattr(handle, "isatty") and handle.isatty()) or \
('TERM' in os.environ and os.environ['TERM']=='ANSI'):
if platform.system()=='Windows' and not ('TERM' in os.environ and os.environ['TERM']=='ANSI'):