Skip to content

Instantly share code, notes, and snippets.

View paultag's full-sized avatar

Paul Tagliamonte paultag

View GitHub Profile
@LocalJoost
LocalJoost / GpsUtils.cs
Last active February 21, 2024 08:07 — forked from govert/GpsUtils.cs
Convert WGS-84 geodetic locations (GPS readings) to Cartesian coordinates in a local tangent plane (Geodetic to ECEF to ENU)
using System;
using System.Diagnostics;
// Some helpers for converting GPS readings from the WGS84 geodetic system to a local North-East-Up cartesian axis.
// The implementation here is according to the paper:
// "Conversion of Geodetic coordinates to the Local Tangent Plane" Version 2.01.
// "The basic reference for this paper is J.Farrell & M.Barth 'The Global Positioning System & Inertial Navigation'"
// Also helpful is Wikipedia: http://en.wikipedia.org/wiki/Geodetic_datum
// Taken from https://gist.github.com/govert/1b373696c9a27ff4c72a
" Place me into after/plugin/fireplace.vim in your Vim directory. Don't overwrite anything!
augroup fireplace_connect
autocmd FileType hy command! -buffer -bar -nargs=*
\ Connect FireplaceConnect <args>
augroup END
function! s:set_up_eval() abort
command! -buffer -bang -range=0 -nargs=? Eval :exe s:Eval(<bang>0, <line1>, <line2>, <count>, <q-args>)
@barakmich
barakmich / gist:3162dca81838d3501e2e
Last active August 29, 2015 14:14
CA Triples Feedback

First, let's get a summary of what's going on:

$ cat ca | cut -f 2 -d " "| sort | uniq -c
  15066 </bill/id>
  15066 </bill/session>
  51722 </bill/sponsor>
 35194 
@stianeikeland
stianeikeland / blackjack.hy
Last active August 29, 2015 14:07
blackjack kata in hy at bergen coding dojo
(require hy.contrib.loop)
(import [random [shuffle]])
(def ranks (+ (range 2 11) [:a :k :q :j]))
(def suits [:h :c :d :s])
;; OH MY IMPERATIVE GAAWD!
(def deck [])
(for [rank ranks
suit suits]
@mnzk
mnzk / fzbz.hy
Last active January 2, 2016 07:09
;; hy-lang fizzbuzz
(import [itertools [count imap]])
(import [pprint [pprint]])
(defn freq [v n]
(->> (* [""] (dec n)) (+ [v])))
(defn fizzbuzz []
(->> (imap (fn [f b n] (or (+ f b) n))
@thomasballinger
thomasballinger / gist:5731729
Last active December 18, 2015 05:19
A section of my vimrc for hy
function! g:Refresh_hy_python_preview()
redir => message
redir END
let pyfile = substitute(bufname("%"), ".hy", "", "") . ".generated.py"
let errfile = substitute(bufname("%"), ".hy", "", "") . ".error"
exec "silent !~/hy/bin/hy2py % > " . pyfile . " 2> " . errfile . " || cat " . errfile . " > " . pyfile
call MyPreviewVSplit(pyfile)
set nomodified
"exec "silent !rm " . pyfile . " " . errfile
redraw!
@olasd
olasd / output
Last active December 15, 2015 20:41
Parsley is fun.
⏚ [nicolasd:~/code/parsley] [parsley] $ python test_parsley.py
('root',
[(1, 0), (346, 0)],
('parens',
[(3, 0), (3, 36)],
('token', [(3, 1), (3, 12)], 'import-from'),
('token',
[(3, 13), (3, 28)],
'tests.resources'),
('token', [(3, 29), (3, 35)], 'kwtest')),
@paultag
paultag / info.md
Last active December 10, 2015 02:09
Hython Runtime

tl;dr

PyPy is ruddy fast. So is Hy.

Time of fib(9), using a simple recursive implementation.

@paultag
paultag / gist:4333969
Created December 19, 2012 02:51
Python in lisp
; vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 filetype=lisp
; Copyright (c) Paul Tagliamonte, in sofar as any of this is at all
; copyrightable.
(puts "Hello, World!")
; "Hello, World!"
(import ["os"
"sys"])
@paultag
paultag / gist:4333914
Created December 19, 2012 02:43
frickn' lisp in frickn' python
; vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 filetype=lisp
; Copyright (c) Paul Tagliamonte, in sofar as any of this is at all
; copyrightable.
(def hello "World!")
(def square (fn [arg]
(* arg arg)))