Skip to content

Instantly share code, notes, and snippets.

View nicholasf's full-sized avatar

Nicholas Faiz nicholasf

View GitHub Profile
Preparing build folder 0.4s
$ mkdir -p "/var/lib/buildkite-agent/builds/buildkite0-1/homepass/firebase-queues"
$ cd "/var/lib/buildkite-agent/builds/buildkite0-1/homepass/firebase-queues"
$ git clean -fdq
$ git submodule foreach --recursive git clean -fdq
$ git fetch -q
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
//running the below produces
// ~/tmp/mongoose-events-test ⮀ ⮀ ⮀ node test ⮂ ruby-2.2.1
// this was new:
// saved: { __v: 0, name: 'emitUpdate', _id: 55ea6f4b05de60396e95e961 }
// saved: { _id: 55ea6f4b05de60396e95e961, name: 'aasdf', __v: 0 }
// saved
// this was removed: { __v: 0, name: 'emitUpdate', _id: 55ea6f4b05de60396e95e961 }
var mongoose = require('mongoose');
mongoose.connect('localhost', 'events');
@nicholasf
nicholasf / macbook-pro-late-2013-for-sale.md
Last active August 28, 2015 23:18
For sale: Macbook pro retina 15'' late 2013, 16 GB, 2.3 GHz

Instead of stockpiling yet another Apple machine (I have 4 old models in the apartment already) I'm selling the macbook retina pro I bought last year.

Here's a link to its specs. It's the top line model from the late 2013 build:

https://support.apple.com/kb/SP690?locale=en_GB

It's in very good working state. I bought it for $3300 (iirc). Happy to sell it for around half that price.

<!-- OSM data for https://www.openstreetmap.org/export#map=17/-37.81972/144.96242 -->
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="CGImap 0.4.0 (2287 thorn-02.openstreetmap.org)" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
<bounds minlat="-37.8187400" minlon="144.9592400" maxlat="-37.8158800" maxlon="144.9625000"/>
<node id="26034533" visible="true" version="14" changeset="28364330" timestamp="2015-01-24T03:16:40Z" user="Vadmium" uid="1795763" lat="-37.8139201" lon="144.9603507">
<tag k="crossing" v="traffic_signals"/>
<tag k="highway" v="traffic_signals"/>
</node>
<node id="2189145378" visible="true" version="3" changeset="28364330" timestamp="2015-01-24T03:16:40Z" user="Vadmium" uid="1795763" lat="-37.8166544" lon="144.9585949">
name := "bogan-ipsum"
version := "1.0"
scalaVersion := "2.11.6"
libraryDependencies ++= {
Seq(
"org.scalatest" %% "scalatest" % scalaTestV % "test",
"org.json4s" %% "json4s-jackson" % "3.2.11"
scala> foo
res7: Array[String] = Array(one, two, three)
scala> foo.foldLeft(List[String]()) { (z, f) => z :+ f.toUpperCase }
res8: List[String] = List(ONE, TWO, THREE)
scala> foo.foldRight(List[String]()) { (z, f) => z :+ f.toUpperCase }
<console>:9: error: value toUpperCase is not a member of List[String]
foo.foldRight(List[String]()) { (z, f) => z :+ f.toUpperCase }
^
scala> var c = new Array(n)
java.lang.OutOfMemoryError: Java heap space
at scala.reflect.ManifestFactory$$anon$5.newArray(Manifest.scala:195)
at scala.reflect.ManifestFactory$$anon$5.newArray(Manifest.scala:194)
... 30 elided
scala> print(n)
1828968639
scala> val foo = "one"
foo: String = one
scala> foo = "two"
<console>:19: error: reassignment to val
foo = "two"
^
scala> //fair enough! but ...
//this following snippet
cmdStr := commandString(*psql, *host, *database, *user, *dir, sqlFile.filename)
_, err := exec.Command(cmdStr).Output()
if err != nil {
fmt.Println(err.Error())
log.Fatal(err)
}
type Repository interface{
Create(model Model) error
Find(model Model, associations ...Association) (Model, error)
FindByID(model Model, id uint, associations ...Association) (Model, error)
FindAll(models interface{}) (interface{}, error)
Update(model Model) error
Delete(model Model) error
}
//A repository object for reuse