Skip to content

Instantly share code, notes, and snippets.

@zobar
zobar / def.shard.rb
Created August 30, 2015 23:54
Nested function definitions are a bad idea in Ruby.
#!/usr/bin/env ruby -w
def defit
def ohai
puts "hello from #{self.class.inspect} #{self.inspect}"
end
puts "called defit in #{self.class.inspect} #{self.inspect}"
end
/* analogtv, Copyright (c) 2003, 2004 Trevor Blackwell <tlb@tlb.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation. No representations are made about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*/
I lived briefly at Orchard near Rivington. The neighborhood has moved on, but
some of my old haunts are still open.
Two Boots, various locations. Cajun/Creole pizza.
Rai Rai Ken, E 10th St. Ramen.
Mamoun's, Washington Sq Park or St Mark's Pl. Lamb shawarma.
Tea & Sympathy, Greenwich Ave. British.
Katz's Deli, E Houston St. Old-school deli.
Paul's, 2nd Ave. Best burgers.
use libc::c_int;
use std::cell::Cell;
pub enum CInterp {}
pub struct Interp {
ptr: Cell<*mut CInterp>,
}
impl Interp {
type 'a why_is_this_ok = {
f: 'b. ('a -> 'b) -> 'b
}
type 'a but_this_is_not = 'b. ('a -> 'b) -> 'b
module Iter = struct
type 'a t = {
fold: 'b. ('b -> 'a -> 'b) -> 'b -> 'b
}
let empty = {
fold = fun f accu -> accu
}
let pure a = {
module Nfa where
import Control.Applicative
import Control.Monad
data State i o
= Reject
| Accept o
| Transition (i -> State i o)
  • 299839 Single-Gang Drawn Handy Box 1-7/8 in. Deep with 1/2 in. KO's
  • 342576 Husky 9 ft. 14/3 Power Tool Replacement Cord
  • 630692 Ideal 33 Orange In-Sure 3-Port Connector (10-Pack)
  • 698646 Leviton 15 Amp Tamper Resistant Duplex Outlet, Black
  • 839647 3/8 in. Non-Metallic (NM) Twin-Screw Cable Clamp Connectors (5-Pack)
  • 908401 Romex 15 ft. 14/2 Soild SIMpull NM-B Cable
  • 1001091470 Gardner Bender 1/2 in. Plastic Staple, White (25-Pack)

Never follow any guidelines without understanding their concrete benefits. Clarity is more important than structure. If code is left ugly but straightforward, it's easy enough to refactor it. If an inappropriate structure is imposed on code, it will need to be detangled first.

You will never know less about a project than you do at the very beginning. You know more about your project today than you have ever known, but you will know even more tomorrow.

  • Think about the future, but defer final decisions until the time is right.
sshpass -p raspberry ssh pi@raspberrypi mkdir .ssh
sshpass -p raspberry scp ~/.ssh/id_rsa.pub pi@raspberrypi:.ssh/authorized_keys
ssh pi@raspberrypi '
set -e
sudo chgrp staff /usr/src
sudo chmod g+ws /usr/src
sudo usermod --append --groups staff pi
sudo passwd -l pi'
ssh -t pi@raspberrypi sudo raspi-config
ssh pi@raspberrypi '