Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Bogdan Bivolaru bogdanbiv

I may be slow to respond.
View GitHub Profile
bogdanbiv /
Last active Feb 25, 2018
Another description for this gist

My dynamic gist.

View bitSmearing.js
// CodeGolf - alternating bit smearing over trailing 00 for numbers in base 2
smear = function (num) {
const old = num;
let replaces = 0, remind = num%4===0, supl = 0;
while (remind) {
bogdanbiv / .gitignore
Last active Aug 29, 2015
Reloading Connect/Express server code using grunt-contrib-watch and reload option
View .gitignore
View ba-objecttotype.js
// See
(function(global) {
// Maintain a map of already-encountered types for super-fast lookups. This
// serves the dual purpose of being an object from which to use the function
// Object.prototype.toString for retrieving an object's [[Class]].
var types = {};
// Return a useful value based on a passed object's [[Class]] (when possible).
Object.toType = function(obj) {
bogdanbiv / Circular Safe Object Inspector
Created Oct 12, 2014
Serialize object keys and values except values that are arrays or other objects. This is to be used in case JSON.stringify fails due to cyclic...
View Circular Safe Object Inspector
function mystringify(input) {
var key, type, retVal = "";
for(key in input) {
if (input.hasOwnProperty(key)) {
type = typeof(input[key]);
if (type === 'array' || type === 'object') {
retVal += key + ": " + type + ", ";
} else {
retVal += key + ": " + input[key] + ", ";
bogdanbiv / jitsu_deploy_shell
Last active Dec 15, 2015
Application cannot start because in the script some symbols are not recognised: dot = error,
View jitsu_deploy_shell
info: Welcome to Nodejitsu bogdanb
info: jitsu v0.12.7, node v0.8.14
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Skipping require-analyzer because noanalyze option is set
info: Skipping require-analyzer because noanalyze option is set
warn: Local package version appears to be old
warn: The package.json version will be incremented automatically
warn: About to write /home/bogdanbiv/WebstormProjects/life-trackr/package.json
bogdanbiv / IsolateRootCause
Last active Dec 15, 2015
Question: Check line 711 will have a error about not finding nasm (Netwide Assembler) in file NPM_install_console_log. Even better check line 455 in file New_NPM_install_console_log and see that it contains the same nasm error, clearly unrelated to tap. What do webapps have to do with "nasm (Netwide Assembler)"? Steps to reproduce: * Install Yeo…
View IsolateRootCause
bogdanbiv@bogdanbiv-P35-DS3:~/WebstormProjects$ mkdir npmtest
bogdanbiv@bogdanbiv-P35-DS3:~/WebstormProjects$ cd npmtest/
bogdanbiv@bogdanbiv-P35-DS3:~/WebstormProjects/npmtest$ npm install jpegtran-bin
npm http GET
npm http 304
npm http GET
npm http GET
npm http 304
npm http 304
You can’t perform that action at this time.