Skip to content

Instantly share code, notes, and snippets.

Why not: from Common Lisp to Julia

This article is a response to mfiano’s From Common Lisp to Julia which might also convey some developments happening in Common Lisp. I do not intend to suggest that someone coming from a Matlab, R, or Python background should pickup Common Lisp. Julia is a reasonably good language when compared to what it intends to replace. You should pickup Common Lisp only if you are interested in programming in general, not limited to scientific computing, and envision yourself writing code for the rest of your life. It will expand your mind to what is possible, and that goes beyond the macro system. Along the same lines though, you should also pickup C, Haskell, Forth, and perhaps a few other languages that have some noteworthy things to teach, and that I too have been to lazy to learn.

/I also do not intend to offend anyone. I’m okay with criticizing Common Lisp (I myself have done it below!), but I want t

@hraban
hraban / README.md
Last active April 13, 2022 17:42 — forked from jamesmacfie/README.md
iTerm 2 - script to change theme depending on Mac OS dark mode
@mikroskeem
mikroskeem / gccemacs_osx.md
Last active July 11, 2023 14:59
gccemacs on OSX

gccemacs on OS X

Read this first: http://akrl.sdf.org/gccemacs.html

Prerequisites

1) GCC with libgccjit enabled

For that you need to compile gcc (duh). I edited Homebrew's gcc formula:

@nepsilon
nepsilon / how-to-use-mac-keychain-to-store-github-repos-credentials.md
Created July 18, 2017 06:50
How to use Mac KeyChain to store GitHub repos credentials? — First published in fullweb.io issue #108

How to use Mac KeyChain to store GitHub repos credentials?

You know the pain, you cloned a repo over HTTPS, and now Git asks you for your password each time you want to push or pull.

Chances are you already have the git credential-osxkeychain command installed. If not, just install Git with brew: brew install git.

Once installed, just tell Git to use the KeyChain to store your credentials:

git config --global credential.helper osxkeychain
@ANDRON94
ANDRON94 / eval-when-test.lisp
Last active August 13, 2023 20:56
Explanation of how 'eval-when' works in Common Lisp
;;; explanation for LOAD *.lisp
;;; 1. Load ignores :compile-toplevel, :load-toplevel
;;; Result: NIL is returned
;;; explanation for COMPILE
;;; 1. not-compile-time(NCT)
;;; 2. ignore mode, EVAL, remains in current mode
;;; Result: print to output 'foo-compile'
;;; explanation for LOAD *.fasl
@hraban
hraban / vectorized-arrays.js
Last active November 10, 2016 15:12
Vectorized .all method on arrays to transparently access all members
Object.defineProperty(Array.prototype, 'all', {
get: function () {
return new Proxy(this, {
get: function(target, name, receiver) {
return target.map(x => x[name]);
},
set: function (target, name, value) {
target.forEach(x => x[name] = value);
},
// ... call:, etc.
@hc2p
hc2p / .travis.yml
Last active November 13, 2020 04:26
This is a prove of concept for leveraging the travis directory caching for speeding up docker builds. It works by configuring the docker deamon to use a folder under current user's (travis) control. That way you have the privileges to use the caching feature of travis ci.
sudo: false
services:
- docker
before_script:
- sudo service docker stop
- if [ "$(ls -A /home/travis/docker)" ]; then echo "/home/travis/docker already set"; else sudo mv /var/lib/docker /home/travis/docker; fi
- sudo bash -c "echo 'DOCKER_OPTS=\"-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -g /home/travis/docker\"' > /etc/default/docker"
- sudo service docker start
@bschlenk
bschlenk / ini2json.py
Last active March 3, 2017 13:56 — forked from Natim/ini2json.py
Convert an ini configuration file into a json file. Retains original order of ini file entries and prints json out with four space indentation.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import sys
from collections import OrderedDict
from ConfigParser import (ConfigParser, MissingSectionHeaderError,
ParsingError, DEFAULTSECT)
@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))
@andrew-d
andrew-d / main.c
Last active December 1, 2023 12:29
Example of how to get current binary's path using Apple's Code Signing Services
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <Security/Security.h>
// Compile with:
// gcc -o ourpath -framework CoreFoundation -framework Security main.c