Skip to content

Instantly share code, notes, and snippets.

@echosa
echosa / att.sh
Last active January 28, 2020 02:58
All The Things - Package Manager Manager
#!/bin/bash
PACKAGE_MANAGERS=()
PACKAGE_MANAGERS+=("apt")
apt_clean() {
sudo apt autoremove
}
apt_search() {
apt search $1
@echosa
echosa / gist:1cfbd0e6c46b6509be260f9bbe170c12
Created October 23, 2017 16:51
Blockstack verification
Verifying my Blockstack ID is secured with the address 1LDneyt7jTNqkj9e3jqoT5PyktYNJidHhV
@echosa
echosa / keybase.md
Created May 4, 2017 21:44
keybase.md

Keybase proof

I hereby claim:

  • I am echosa on github.
  • I am echosa (https://keybase.io/echosa) on keybase.
  • I have a public key ASD2jj6mJb0DwaT6czvdBkkuEliXIwDfN8oOBzQa_u8G7Ao

To claim this, I am signing this object:

@echosa
echosa / Brave-issues.md
Last active September 17, 2024 06:26
Brave browser issues
@echosa
echosa / comp.sh
Created August 30, 2014 18:02
Clojure core.typed comparator
;; Trying to annotate a comparator that sorts a list of namespaces alphabetically
zork-fortress.core=> (clojure.core.typed/cf (comp (t/fn [ns1 :- clojure.lang.Namespace ns2 :- clojure.lang.Namespace] :- t/Num (compare (str ns1) (str ns2)))))
Type Error (/private/var/folders/s1/t0k7x43122ggbclq88zgjl400000gn/T/form-init8319721319789341749.clj:1:24) Polymorphic function comp could not be applied to arguments:
Polymorphic Variables:
x
y
b
Domains:
@echosa
echosa / history-cmd.clj
Last active August 29, 2015 14:04
history command that I can't get to get properly typed
(t/ann ^:no-check history-cmd [t2/Game -> String])
(defn history-cmd
"The history command."
[game]
(str "*** START HISTORY ***"
(w/walk #(str "\n> " (:command %) "\n\n" (:response %) "\n")
#(apply str %)
(if (< (count (:turn-history game)) 4)
(:turn-history game)
(subvec (:turn-history game) (- (count (:turn-history game)) 4))))
@echosa
echosa / trail
Created July 10, 2014 14:25
Delete trailing spaces in Acme
#!/usr/bin/env bash
# Removes trailing spaces from entire window.
# Run as `trail` (no | or < necessary)
# Inspired by:
# http://www.mostlymaths.net/2013/03/extensibility-programming-acme-text-editor.html
echo -n "0,$" | 9p write acme/$winid/addr
9p read acme/$winid/body | sed 's/ *$//g' | 9p write acme/$winid/data
echo -n "0,0" | 9p write acme/$winid/addr
(ann player-character String)
(def player-character
"The character that represents the player."
"@")
(ann find-player
[(IPersistentVector (IPersistentVector Any))
->
(Vector* Number Number)])
(defn find-player
<html>
<head>
<style type="text/css">
.container {
width: 100%;
border: 1px solid black;
background: #CCCCCC;
}
.theFloat {
<?php
/**
* For easy of posting to Gist, I have put everything in one file called
* knight.php. The getValidKnightSquares() function is first in the file.
*
* The require_once is there to load PHPUnit installed with Composer. There is a
* unit test class for the getValidKnightSquares() function at the end of this
* file.
*/
namespace Chess;