Skip to content

Instantly share code, notes, and snippets.

View jeffheifetz's full-sized avatar

Jeffrey Heifetz jeffheifetz

View GitHub Profile
@jeffheifetz
jeffheifetz / flatten.js
Created July 16, 2016 01:15
Array flattener
'use strict'
var input = [1, [2, 3, [4, [5], 6], 7, [8], 9], 10]
function flatten (array) {
let result = []
if (!Array.isArray(array) || array.length === 0) {
return result
}
while (array.length > 0) {
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Darwin)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER o32-clang)
SET(CMAKE_CXX_COMPILER o32-clang++-libc++)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /home/vagrant/osxcross/target/macports/pkgs/opt/local/)
SET(CMAKE_OSX_SYSROOT /home/vagrant/osxcross/target/SDK/MacOSX10.11.sdk/)
@jeffheifetz
jeffheifetz / gst-inspect.output
Created September 11, 2015 01:16
GStreamer Example Output
ubuntu@ip-172-30-16-245:~/EquirectWorker$ ./gst-inspect.rb
./gst-inspect.rb:108: [BUG] Segmentation fault at 0x00000000000000
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0004 p:0025 s:0018 e:000016 METHOD ./gst-inspect.rb:108
c:0003 p:0018 s:0013 e:000012 METHOD ./gst-inspect.rb:70
c:0002 p:0105 s:0007 E:000fb8 EVAL ./gst-inspect.rb:477 [FINISH]
c:0001 p:0000 s:0002 E:001f00 TOP [FINISH]
@jeffheifetz
jeffheifetz / controllerWebView.js
Created July 15, 2013 19:33
Modifying WebWorks framework to allow console logging. This file should be placed in Framework/lib/controllerWebView.js
/*
* Copyright 2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software