Skip to content

Instantly share code, notes, and snippets.

@nycdavid
nycdavid / giospr1-notes.md
Last active April 25, 2025 02:36
Notes for GIOS Project 1

This turned out a bit longer than I expected, so here's the conclusion

Echo Server/Client

Although there was a bit of ramp up time, I found this portion of the project to be a great primer on creating, connecting to and transmitting with sockets.

As far as resources go, I may very well be in the minority in that I didn't find things like Beej's Guide to Network Programming or the Linux Programming Interface to be particularly helpful as a first resource for this exercise. As thorough as they are, they were almost too indepth and I wound up inadvertently complicating things by attempting to apply the patterns in it.

The best resources for me were:

<div class="report-table mobile-clear">
<div class="report-row unit-row">
<div class="report-cell one-fifty">
<div class="report-row-label">
<label>&nbsp;</label>
</div>
</div>
<div class="report-cell one-twenty">
<div class="report-row-label">
<label>Lvls:</label>
@nycdavid
nycdavid / test3.md
Last active December 9, 2017 01:45
Test 3 Review
  1. Given:
    • A list of numbers
    • Two different sorting algorithms
    • Use cost i.e. different cost value for a move vs. comparison
    • Determine which algorithm is the most efficient
  2. Heap sort
  3. Determining average number of reads in a BST
    • Multiply the number of nodes by the level number
    • Divide by the number of nodes
  4. Deleting nodes from a BST:
@nycdavid
nycdavid / sample.go
Created November 10, 2017 18:07
Sample code for interface post
package main
import (
"fmt"
"bytes"
"strconv"
)
type operand interface {
}
@nycdavid
nycdavid / valuer.go
Created November 9, 2017 22:11 — forked from jmoiron/valuer.go
Example uses of sql.Scanner and driver.Valuer
package main
import (
"bytes"
"compress/gzip"
"database/sql/driver"
"errors"
"fmt"
"github.com/jmoiron/sqlx"
_ "github.com/mattn/go-sqlite3"
@nycdavid
nycdavid / info.MD
Last active October 25, 2017 15:36
Grokking Faktory
  • Getting a CLI Shell to talk to the Faktory job server: cat <(echo "HELLO {\"wid\":\"4qpc2443vpvai\", \"labels\": [\"golang\"]}") - | nc localhost 7419

Enqueuing a test job from command line:

  1. First, open a persistent connection via Netcat to the Faktory job server:
      $> cat <(echo "HELLO {\"wid\":\"4qpc2443vpvai\", \"labels\": [\"golang\"]}") - | nc localhost 7419
      #=> +HI {"v":"1"}
      #=> +OK
    
  2. Then, PUSH a job to the end of the queue, with at least the minimum parameters of jid, jobtype, args:
console.log($('body'));
@nycdavid
nycdavid / test.go
Last active January 20, 2016 22:39
template.Parse("<h1>Foo</h1>")
template.Parse(`<h1>Foo</h1>`)
@nycdavid
nycdavid / avid_mover.rb
Last active June 10, 2016 16:22
AvidMover class
require "fileutils"
class AvidMover
Bin = Struct.new(:type, :genre, :filename)
def initialize(project_path)
@project_path = project_path
end
def move_bins
@nycdavid
nycdavid / project_folder_generator.rb
Last active January 7, 2016 17:45
ProjectFolderGenerator class
require "csv"
require "fileutils"
TYPES = ["Instrumental", "Vocal"]
GENRES = [
"Ambient", "Americana", "Blues", "Childrens", "Classical",
"Country", "Disco", "Easy Listening", "Electronica", "Folk",
"Funk", "Gospel", "Hip Hop", "Holiday", "Jazz", "Latin",
"Lounge", "None", "Orchestral", "Pop", "R&B", "Reggae",