This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Every command, function, or variable intended for users to know about should have a documentation string. | |
An internal variable or subroutine of a Lisp program might as well have a documentation string. Documentation strings take up very little space in a running Emacs. | |
Format the documentation string so that it fits in an Emacs window on an 80-column screen. It is a good idea for most lines to be no wider than 60 characters. The first line should not be wider than 67 characters or it will look bad in the output of apropos. | |
Use blank lines between sections if the documentation string is long. | |
The first line of the documentation string should consist of one or two complete sentences that stand on their own as a summary. M-x apropos displays just the first line, and if that line's contents don't stand on their own, the result looks bad. In particular, start the first line with a capital letter and end it with a period. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; General form | |
;;; CL has two fundamental pieces of syntax: ATOM and S-EXPRESSION. | |
;;; Typically, grouped S-expressions are called `forms`. | |
10 ; an atom; it evaluates to itself | |
:thing ; another atom; evaluating to the symbol :thing | |
t ; another atom, denoting true | |
(+ 1 2 3 4) ; an s-expression | |
'(4 :foo t) ; another s-expression |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(fn love.draw [] | |
(love.graphics.print "Hello World!" 400 300)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# So recently I noticed that I was getting notifications on YouTube for channels that I had not enabled any notifications for. | |
# I checked in the youtube settings (see the url in this script), and realized that for some reason they had ALL been | |
# enabled. I wanted to disable them all, but I have several hundred channels that I sub to, and didn't want to go through | |
# all of them and click the option. | |
# | |
# Selenium to the rescue!!! | |
# | |
# So, you need to somehow get in to a session with your account signed in. I just started the driver, put a 40 second sleep, | |
# then signed in manually. Then the next time I ran this script, the driver was in my session. I dunno, not used to it working | |
# like that. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env perl | |
use strict; | |
my $default = 3; | |
my $lines = @ARGV[0] || $default; | |
$lines = 3 if $lines < 0; | |
for( my $i = $lines; $i > 0; $i-- ) { | |
if ( $i == ($lines / 2) || | |
$i == (($lines + 1) / 2) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(in-package :cl-user) | |
(defpackage :hello-world-system | |
(:use :asdf)) | |
(in-package :hello-world-system) | |
(defsystem "hello-world" | |
:version "0.1.0" | |
:author "Jason" | |
:license "LLGPL" | |
:description "Say hi." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestTestDeps | |
{ | |
@Test(alwaysRun = true) | |
public void testZ() | |
{ | |
System.out.println("z is running"); | |
assertEquals(1, 1); | |
} | |
@Test(dependsOnMethods = "testZ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/sbcl --script | |
;;; Documentation: | |
;;; Commentary: | |
;;; Code: | |
(defun timer-tick () | |
"Waits for 1 second" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project name="MyProject" default="dist" basedir="."> | |
<description> | |
simple example build file | |
</description> | |
<!-- set global properties for this build --> | |
<property name="src" location="src"/> | |
<property name="build" location="build"/> | |
<property name="dist" location="dist"/> | |
<target name="init"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun all (seq fn) | |
"Immediately return NIL if FN returns NIL for any item in SEQ." | |
(loop for i in seq | |
always (funcall fn i))) | |
(all '(1 2 3) (lambda (x) (< x 5))) | |
;; => T | |
(all '(1 2) (lambda (x) (= x 1))) | |
;; => NIL |