Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Jonatas Walker jonataswalker

I may be slow to respond.
  • Campinas, Brasil
View GitHub Profile

Electron SQLite3 Integration

When trying to use the node-sqlite3 module in Electron I got the error:

Error: Cannot find module '/path/to/my/application/node_modules/sqlite3/lib/binding/electron-v1.4-linux-x64/node_sqlite3.node'

Using Ubuntu 16.04 with Node 7.1.0 and Electron 1.4.12.

I read the following:

View Twitch sample API responses in array form
"stream": {
"mature": false,
"status": "Greg working on Electron-Vue boilerplate w/ Akira #programming #vuejs #electron",
"broadcaster_language": "en",
"display_name": "FreeCodeCamp",
"game": "Creative",
"language": "en",
"_id": 79776140,
View gist:f08c65400a46c470d29b6fc6da300f23
* An implementation for Quicksort. Doesn't
* perform as well as the native Array.sort
* and also runs the risk of a stack overflow
* Tests with:
* var array = [];
* for(var i = 0; i < 20; i++) {
* array.push(Math.round(Math.random() * 100));
jonataswalker / baseConverter.js
Created Jun 10, 2016 — forked from faisalman/baseConverter.js
Convert From/To Binary/Decimal/Hexadecimal in JavaScript
View baseConverter.js
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript
* Copyright 2012-2015, Faisalman <>
* Licensed under The MIT License
jonataswalker / bsort.js
Created Jun 9, 2016 — forked from tixxit/bsort.js
Fast Bucket Sort for Integers in JS
View bsort.js
// Copyright 2011, Tom Switzer
// Under terms of ISC License:
* Sorts an array of integers in linear time using bucket sort.
* This gives a good speed up vs. built-in sort in new JS engines
* (eg. V8). If a key function is given, then the result of
* key(a[i]) is used as the integer value to sort on instead a[i].
* @param a A JavaScript array.
jonataswalker / LICENSE.txt
Created Jun 8, 2016 — forked from binarymax/LICENSE.txt
Powerset from array
View LICENSE.txt
Copyright (c) 2011 Max Lovenheim Irwin,
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
jonataswalker / codility_solutions.txt
Created May 21, 2016 — forked from lalkmim/codility_solutions.txt
Codility Solutions in JavaScript
View codility_solutions.txt
Lesson 1 - Iterations
- BinaryGap -
Lesson 2 - Arrays
- OddOccurrencesInArray -
- CyclicRotation -
Lesson 3 - Time Complexity
- FrogJmp -
- PermMissingElem -
jonataswalker / 1_phantomErrors.js
Created May 5, 2016 — forked from artjomb/1_phantomErrors.js
Error event handlers for PhantomJS and CasperJS: PhantomJS and CasperJS don't show errors on the page by default. This can give clues as to what did go wrong.
View 1_phantomErrors.js
var page = require('webpage').create(),
url = '';
// Put the event handlers somewhere in the code before the action of
// interest (opening the page in question or clicking something)
page.onConsoleMessage = function(msg, lineNum, sourceId) {
console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")');
jonataswalker /
Created May 4, 2016 — forked from n1k0/
CasperJS test cli hooks example

Put test1.js and test2.js into a tests/ directory, then run the suite:

$ casperjs test tests/ --pre=pre.js --includes=inc.js --post=post.js
Test file: /Users/nperriault/tmp/pre-inc/pre.js                                 
Hey, I'm executed before the suite.
Test file: /Users/nperriault/tmp/pre-inc/tests/test1.js                         
# this is test 1
Hi, I've been included.
PASS Subject is strictly true
jonataswalker / .eslintrc
Created Mar 30, 2016 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
View .eslintrc
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names