Skip to content

Instantly share code, notes, and snippets.

@echosa
echosa / att.sh
Last active Jan 28, 2020
All The Things - Package Manager Manager
View att.sh
#!/bin/bash
PACKAGE_MANAGERS=()
PACKAGE_MANAGERS+=("apt")
apt_clean() {
sudo apt autoremove
}
apt_search() {
apt search $1
View gist:1cfbd0e6c46b6509be260f9bbe170c12
Verifying my Blockstack ID is secured with the address 1LDneyt7jTNqkj9e3jqoT5PyktYNJidHhV
View 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 Mar 30, 2018
Brave browser issues
View Brave-issues.md
@echosa
echosa / comp.sh
Created Aug 30, 2014
Clojure core.typed comparator
View comp.sh
;; 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 Aug 29, 2015
history command that I can't get to get properly typed
View history-cmd.clj
(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 Jul 10, 2014
Delete trailing spaces in Acme
View trail
#!/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
View indexOf-annotations.clj
(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
View float-fix.html
<html>
<head>
<style type="text/css">
.container {
width: 100%;
border: 1px solid black;
background: #CCCCCC;
}
.theFloat {
View knight.php
<?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;