Skip to content

Instantly share code, notes, and snippets.

I tried to write a function that would flatten nested arrays but my solution did not work when I used the Array.prototype.concat method. As a work around, I used the Array.prototype.forEach method and it worked as expected. Both implimentations are below.
Does you know why .concat() doesn't work?

@thibblen
thibblen / all.js
Created November 7, 2013 18:07
extending
var _ext = {};
var _ = require('underscore');
_ext = _.extend(_ext, require('./one'));
_ext = _.extend(_ext, require('./two'));
module.exports = _ext;
@thibblen
thibblen / gist:7256286
Created October 31, 2013 20:13
when you get a message like this : Heterogeneous queries and use of OLEDB providers are not supported in fiber mode
sp_configure 'show advanced options', 1;
GO
sp_configure 'lightweight pooling', 0;
GO
RECONFIGURE;
GO
var data = $(form).serialize();
var url = $(form).attr('action');
$.ajax({
type: 'POST',
url: url,
cache: false,
data: data,
success: function (result) {
$(form).closest('.element').html(result);
@thibblen
thibblen / gist:799396
Created January 27, 2011 22:12
form questions
public class FormQuestion
{
public decimal sort { get; set; }
public bool IsAmount { get; set; }
public bool IsLevelBreak { get; set; }
[JsonIgnore]
[DisplayName("Check to delete.")]
public bool Delete { get; set; }