Skip to content

Instantly share code, notes, and snippets.

@hraban
hraban / pre-commit.md
Last active April 18, 2024 06:46
Prevent accidentally committing debug code in Git
@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))

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

@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
@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
@Natim
Natim / ini2json.py
Created January 11, 2013 10:21
Convert an ini configuration file into a json file
# -*- coding: utf-8 -*-
import json
import sys
from ConfigParser import (ConfigParser, MissingSectionHeaderError,
ParsingError, DEFAULTSECT)
class StrictConfigParser(ConfigParser):
def _read(self, fp, fpname):
@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
@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:

@keithamus
keithamus / Nano Git Commit Syntax highlighting
Created December 10, 2010 13:58
Add this to your ~/.nanorc and when running "git commit" (if your editor is nano) you'll have syntax highlighting in your commit message. Includes support for "git commit -v" too!
syntax "gitcommit" "COMMIT_EDITMSG$"
color white "#.*"
color green "#.(modified|deleted).*"
color yellow start="# Changes.*" end="# Changed.*"
color cyan start="# Untracked.*" end="diff"
color cyan start="# Untracked.*" end="$$"
color brightred "^deleted file mode .*"
color brightgreen "^\+.*"
color brightred "^-.*"
color brightyellow "^(diff|index|---|\+\+\+).*"
@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