Skip to content

Instantly share code, notes, and snippets.

@nmiano1111
nmiano1111 / .bash_profile
Created January 23, 2017 18:23 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
package main
import (
"fmt"
"sync"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
import (
"fmt"
"golang.org/x/tour/tree"
)
// Walk walks the tree t sending all values
// from the tree to the channel ch.
func Walk(t *tree.Tree, ch chan int) {
if t.Left != nil {
go Walk(t.Left, ch)
@nmiano1111
nmiano1111 / WordCounter.scala
Last active August 27, 2015 06:30 — forked from Diego81/WordCounter.scala
Simple Word Counter implemented using Akka
import akka.actor.{ Actor, ActorRef, Props, ActorSystem }
case class ProcessStringMsg(string: String)
case class StringProcessedMsg(words: Integer)
class StringCounterActor extends Actor {
def receive = {
case ProcessStringMsg(string) => {
val wordsInLine = string.split(" ").length
sender ! StringProcessedMsg(wordsInLine)
package com.example
import akka.actor._
import akka.routing.RoundRobinRouter
import scala.concurrent.duration.{Duration, _}
/**
* Code from http://doc.akka.io/docs/akka/2.0.1/intro/getting-started-first-scala.html
* I'm keeping it around for easy reference. :)
@nmiano1111
nmiano1111 / ToyNet.scala
Last active August 29, 2015 14:26
Translation of the script from this blog post: http://iamtrask.github.io/2015/07/12/basic-python-network/ from python and numpy to scala and nd4j (http://nd4j.org/).
import org.nd4j.api.linalg.DSL._
import org.nd4j.linalg.api.ndarray.INDArray
import org.nd4j.linalg.factory.Nd4j
import org.nd4j.linalg.lossfunctions.LossFunctions
import org.nd4j.linalg.ops.transforms.Transforms
/**
* A very simple neural network implementation using Scala and
* ND4J. The network is trained to recognize valid xors.
*/
$ redis-cli
> config set stop-writes-on-bgsave-error no
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'