Thomas Blobaum

Node.js

Because you rock when you don't block
Aug 9, 2012 13:47
@nirth where does someArguments come from?
Aug 9, 2012 11:55
git stuff in node \o/
May 13, 2012 01:10
hello @TehShrike
May 5, 2012 23:13
statistics module
May 4, 2012 20:42
i made another module, yay
 

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Aug 9, 2012 12:08
git stuff in node.js github.com/tblobaum/git-rev
Aug 7, 2012 02:45
greetings
Aug 5, 2012 09:28
vector style stuff that works everywhere is pretty appealing
Aug 5, 2012 09:27
dunno, depends on use cases
Aug 5, 2012 09:27
if you need a single image then take font-awesome into photoshop and get your image
Aug 5, 2012 09:25
@Abhishek font-awesome > that stuff
May 13, 2012 01:15
nm
May 13, 2012 01:09
hello
May 6, 2012 00:13
@Raynos lol that made our cat wake up and freak out
May 5, 2012 23:09
statistical calculations with arrays, minimalist style
Apr 8, 2012 18:01
the idea is that calling that ^ will return false
Apr 8, 2012 18:01
if you call defined(undefined, false, '', 0, 1)
Apr 8, 2012 18:01
[0] could return undefined
Apr 8, 2012 17:55
any other comments? :D
Apr 8, 2012 17:51
@FlorianMargaine no reason
Apr 8, 2012 17:50
woops, fixed the global leaked retval
Apr 8, 2012 17:48
gist: 2338725, 2012-04-08 17:48:16Z
// returns the first defined argument, which is useful for cleanly
// setting values with multiple potential defaults
function defined () {
  Array.prototype.slice.call(arguments).reverse().forEach(function (arg) {
    if (typeof arg !== 'undefined') 
      retval = arg
  })
  return retval
}

var baz = false

// example
function example (options) {
  options = defined(options, {})
  var foo = defined(options.foo, 'foo-default-value')
    , bar = defined(options.bar, baz, 'bar-default-value')
  console.log(options, foo, bar)
}
example({ foo: false })

// typical pseudo-equivalent, which merely tests for falsy values
function badIdea (options) {
  options = options || {}
  var foo = options.foo || 'foo-default-value'
    , bar = options.bar || baz || 'bar-default-value'
  console.log(options, foo, bar)
}
badIdea({ foo: false })

// actual equivalent, which is fairly verbose
function equivalent (options) {
  var foo
    , bar
  if (typeof options == 'undefined') {
    options = {}
  }
  if (typeof options.foo != 'undefined') {
    foo = options.foo
  }
  else {
    foo = 'foo-default-value'
  }
  if (typeof options.bar != 'undefined') {
    bar = options.bar
  }
  else if (typeof baz != 'undefined') {
    bar = baz
  }
  else {
    bar = 'bar-default-value'
  }
  console.log(options, foo, bar)
}
equivalent({ foo: false })
 

Lounge<C++>

Today we're daydreaming about C++26 reflection
May 13, 2012 02:50
mm
May 13, 2012 02:47
its 9:45 pm
May 13, 2012 02:46
<_>
May 13, 2012 02:45
btw, for some reason if i put title inside open i get a bunch of garbage for the title in my actual syslogs, if i put it outside and use WriteAscii then it works
May 13, 2012 02:44
already noticed something
May 13, 2012 02:44
crap
May 13, 2012 02:44
uh
May 13, 2012 01:23
@Insilico thanks
May 13, 2012 01:20
@CatPlusPlus just making you aware of the purpose
May 13, 2012 01:20
@CatPlusPlus I need to provide char for syslog
May 13, 2012 01:18
@CatPlusPlus whats the right way to do that?
May 13, 2012 01:17
@TonyTheLion i really dont mind, i'd rather the code be better
May 13, 2012 01:17
@Insilico not currently no
May 13, 2012 01:17
@Insilico why, what implications does that have over just Handle
May 13, 2012 01:15
what @CatPlusPlus said
May 13, 2012 01:15
what is another way I could set the title/facility/log_upto so they arent globals, and what loc are the needless casts?
May 13, 2012 01:14
@DeadMG macros?
May 13, 2012 01:09
(its pretty short)
May 13, 2012 01:08
anyone that would review my code for newb mistakes?
May 13, 2012 01:03
herro!
May 13, 2012 01:02
anyone here use syslog.h much