Skip to content

Instantly share code, notes, and snippets.

View relrod's full-sized avatar

Rick Elrod relrod

View GitHub Profile
@relrod
relrod / sine.hs
Last active August 26, 2015 04:36
Playing around with audio
module Main where
import Data.Binary.Put
import qualified Data.ByteString.Lazy as BL
import Data.Word
newtype Seconds = Seconds Double
newtype Hertz = Hertz Double
sampleRate :: Double
@relrod
relrod / gist:8820800
Created February 5, 2014 10:29
isysuclosed.com vhost
<VirtualHost *:80>
ServerName isysuclosed.com
ServerAlias www.isysuclosed.com
ErrorLog logs/isysuclosed.com-error_log
CustomLog logs/isysuclosed.com-access_log combined
Redirect / http://hashellfrozenover.com/
</VirtualHost>
@relrod
relrod / gist:9027501
Created February 16, 2014 00:40
Beaglebone Black kernel panic
[ 335.927149] Unable to handle kernel paging request at virtual address fffffff8
[ 335.934738] pgd = dc554000
[ 335.937579] [fffffff8] *pgd=9fef6821, *pte=00000000, *ppte=00000000
[ 335.944184] Internal error: Oops: 17 [#1] SMP ARM
[ 335.949118] Modules linked in: pps_ldisc pps_core omapdss(+) ip6t_rpfilter ip6t_REJECT xt_conntrack cfg80211 rfkill ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_natk
[ 336.034588] CPU: 0 PID: 261 Comm: systemd-journal Tainted: G W 3.12.9-301.fc20.armv7hl #1
[ 336.044077] task: db25a600 ti: dc330000 task.ti: dc330000
[ 336.049827] PC is at musb_g_rx+0xec/0x160 [musb_hdrc]
[ 336.055160] LR is at musb_interrupt+0xb88/0xcd0 [musb_hdrc]
[ 336.061010] pc : [<bf32238c>] lr : [<bf31c6b0>] psr: 400f0193
@relrod
relrod / gist:9505572
Last active August 29, 2015 13:57
Lens dependencies for Fedora
Unpackaged ghc-lens deps:
BuildRequires: ghc-bifunctors-devel #
BuildRequires: ghc-comonad-devel #
BuildRequires: ghc-contravariant-devel #1075598
BuildRequires: ghc-distributive-devel #1075605
BuildRequires: ghc-exceptions-devel #1075601
BuildRequires: ghc-profunctors-devel #
BuildRequires: ghc-reflection-devel #1076737
-----------------------------------------------------------------------------
-- |
-- Module : MorseTree
-- Copyright : (c) 2014 Ricky Elrod
-- License : BSD-style
-- Maintainer : Ricky Elrod <ricky@elrod.me>
-- Stability : experimental
-- Portability : Portable
--
-- TODO: Probably should use Data.Tree instead, for better library support.
[root@localhost bin]# lsusb
Bus 002 Device 021: ID 046d:0825 Logitech, Inc. Webcam C270
Bus 002 Device 020: ID 0d8c:000e C-Media Electronics, Inc. Audio Adapter (Planet UP-100, Genius G-Talk)
Bus 002 Device 019: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 002 Device 018: ID 05e3:0606 Genesys Logic, Inc. USB 2.0 Hub / D-Link DUB-H4 USB 2.0 Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
@relrod
relrod / LICENSE
Last active August 29, 2015 13:57
Sort-of working 8-bit ASCII RTTY
Copyright (c) 2014, Ricky Elrod
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
04-01 23:56 root DEBUG fedora-review 0.5.1 bb9bf27 2013-12-13 12:40:49 +0100 started
04-01 23:56 root DEBUG Command line: /usr/bin/fedora-review -b 1082515
04-01 23:56 root INFO Processing bugzilla bug: 1082515
04-01 23:56 root INFO Getting .spec and .srpm Urls from : 1082515
04-01 23:56 root DEBUG Active settings after processing options
04-01 23:56 root DEBUG resultdir: None
04-01 23:56 root DEBUG verbose: False
04-01 23:56 root DEBUG no_report: False
04-01 23:56 root DEBUG session_log: /home/ricky/.cache/fedora-review.log
04-01 23:56 root DEBUG list_flags: False
[
[
":return",
[
":ok",
"9 : Integer",
[
[
"0",
"1",
package me.elrod.ph.examples
import scalaz._, Scalaz._, effect._, IO._
import me.elrod.ph.{Ph => http}
object DisplayIP extends SafeApp {
override def runc: IO[Unit] =
for {
ip <- http get "http://da.gd/ip?text&strip"
_ <- ip match {