Skip to content

Instantly share code, notes, and snippets.

Avatar

Xander Dunn xanderdunn

View GitHub Profile
View gist:fd58639734b1a69dbc65
set clipboard=unnamed
set nocompatible " Use vim settings
set modelines=0 " Prevent security hole
" All tabs are 4 spaces
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
View gist:4762b8e0cbf51bd07740
encoding = "UTF-8"
config.version = "8"
virtualHW.version= "11"
guestOS = "darwin14-64"
memsize = "4096"
displayname = "Mac"
sata0.present = "TRUE"J
sata0:0.present = "TRUE"
sata0:0.fileName = "/vmfs/volumes/datastore1/Mac.vmdk"
sata0:1.present = "TRUE"
View gist:a0917d306d63a70447c2
" TODO
" - Figure out how to jump around .h/.m files with ctags
" - How to jump to next item in quickfix list?
" - How will I manage Coverity Scan submissions? Just do a git cherry-pick -n
" or rebase squish whenever you want to submit the coverity_scan branch
" - Get through the sample and buy the algorithms book
" - Get Coverity Scan working once you meet the 85% code requirement
" TODO Later
" - Set a sanitizer special case list so that it ignores any problems in the
View gist:a48ba62077381b827f89
#!/usr/bin/env python
#
# Copyright (C) 2014 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
View gist:b9b3787b43cb47eeab6f
" TODO
" - Figure out how to jump around .h/.m files with ctags
" - Find some code dependency measurer: Find the GitHub repo of the guy who created a project for this.
" - Create a command that will create a NAME.cpp, NAME.hpp, and TAME.test.cpp file all in the right place
" - Figure out how to jump to the next line that has something marked in the gutter
" - Figure out what conflicts with <leader>n in Python files
" - Create a command that will display a symbol in the gutter for every line that was changed within the past x days. This would be super helpful for debugging.
" TODO Later
" - Set a sanitizer special case list so that it ignores any problems in the third party files: http://llvm.org/releases/3.6.0/tools/clang/docs/SanitizerSpecialCaseList.html
@xanderdunn
xanderdunn / doodle_build.txt
Created Aug 5, 2015
doodle.git build output
View doodle_build.txt
Xander-Dunns-MacBook-Pro:gridworld admin$ cd ~/Desktop/
Xander-Dunns-MacBook-Pro:Desktop admin$ git clone https://github.com/underscoreio/doodle.git
Cloning into 'doodle'...
remote: Counting objects: 1553, done.
remote: Total 1553 (delta 0), reused 0 (delta 0), pack-reused 1553
Receiving objects: 100% (1553/1553), 1.16 MiB | 646.00 KiB/s, done.
Resolving deltas: 100% (503/503), done.
Checking connectivity... done.
Xander-Dunns-MacBook-Pro:Desktop admin$ cd doodle/
Xander-Dunns-MacBook-Pro:doodle admin$ sbt
@xanderdunn
xanderdunn / build.sbt
Created Aug 23, 2015
Trying to figure out Scala code coverage
View build.sbt
name := "ticTacToe"
version := "1.0"
scalaVersion := "2.11.7"
resolvers ++= Seq(
// other resolvers here
// if you want to use snapshot builds (currently 0.12-SNAPSHOT), use this.
"Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/",
"Sonatype Releases" at "https://oss.sonatype.org/content/repositories/releases/"
)
resolvers += Classpaths.sbtPluginReleases
@xanderdunn
xanderdunn / .ensime
Created Sep 16, 2015
Example gradle plugin produced .ensime for xanderdunn/reinforcementLearning
View .ensime
(:root-dir "/local/dev/reinforcementLearning"
:cache-dir "/local/dev/reinforcementLearning/build/ensime_cache"
:name "reinforcementLearning"
:scala-version "2.11.7"
:subprojects ((:name "reinforcementLearning"
:target "/local/dev/reinforcementLearning/build/classes/main"
:test-target "/local/dev/reinforcementLearning/build/classes/test"
:compile-deps ("/Users/admin/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.11.7/f75e7acabd57b213d6f61483240286c07213ec0e/scala-library-2.11.7.jar")
:runtime-deps ("/Users/admin/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.11.7/f75e7acabd57b213d6f61483240286c07213ec0e/scala-library-2.11.7.jar")
:test-deps ("/Users/admin/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.11.7/f75e7acabd57b213d6f61483240286c07213ec0e/scala-library-2.11.7.jar" "/Users/admin/.gradle/caches/modules-2/files-2.1/org.scalatest/scalatest_2.11/2.3.0-SNAP2/b02b4673e62375c30040316462c33fb069cdc76b/scalatest_2.11-2.3.0-SNAP2.jar" "/Users/admin/.gradle/
@xanderdunn
xanderdunn / rxScala.scala
Created Oct 9, 2015
Simples asynchronous RxScala example
View rxScala.scala
Observable(
subscriber => {
new Thread(new Runnable() {
def run() {
val i = 0 // do real shit here instead
subscriber.onNext(i)
}
if (!subscriber.isUnsubscribed) {
subscriber.onCompleted()
}
@xanderdunn
xanderdunn / scalazStreamExamples.md
Last active Oct 23, 2015
Scalaz-Stream By Example
View scalazStreamExamples.md

Mindset

Moving from imperative programming to functional programming requires a fairly large shift in mindset. Moving away from your mutable variables and control flow loops to a streams-based system of handling side effects requires a similar shift in mindset.

A Task encapsulates side effects. You can do just about anything you want in a Task. A Process as a stream of a specific piece of data. Think of it as a list of that data. For example, if you have a counter in your application, a single Process would be used to represent that Int. Think of a Process as a function that holds state that waits to emit a value when it's asked to. A Process is a state machine that can be in one of three states: emitting values, awaiting for the result of some request, or halted. It represents all values that you expect to get from your function. Those values could be simple, like a list of Ints, or it could be far more complex, like asynchronously waiting for responses from a remote server.

You can’t perform that action at this time.