Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Jonatas Walker jonataswalker

💭
I may be slow to respond.
  • Campinas, Brasil
View GitHub Profile
@jonataswalker
jonataswalker / index.html
Created Jul 5, 2019
Bl.ocks.org example
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Bl.ocks.org example</title>
</head>
<body>
<h1>Teste</h1>
</body>
@jonataswalker
jonataswalker / introrx.md
Created Jun 12, 2019 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
@jonataswalker
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
* https://gist.github.com/faisalman
*
* Copyright 2012-2015, Faisalman <fyzlman@gmail.com>
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
*/
(function(){
View flat-object.js
// Turns
{
inputQueryId: 'gcd-input-query',
cssClasses: {
namespace: 'ol-geocoder',
spin: 'gcd-pseudo-rotate'
glass: {
container: 'gcd-gl-container'
}
}
@jonataswalker
jonataswalker / custom
Created Apr 17, 2017 — forked from zoqaeski/custom
xkbcomp keyboard layout dump
View custom
// $XDG_CONFIG_HOME/xkb/symbols/custom
// Makes ALT + CAPS_LOCK act as 3rd level switch
// Works sporadically
partial modifier_keys
xkb_symbols "alt_caps_mode_switch" {
key <CAPS> {
type[Group1]="PC_ALT_LEVEL2",
[ Caps_Lock, ISO_Level3_Shift ]
};
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
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: http://www.isc.org/software/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
jonataswalker / LICENSE.txt
Created Jun 8, 2016 — forked from binarymax/LICENSE.txt
Powerset from array
View LICENSE.txt
Copyright (c) 2011 Max Lovenheim Irwin, http://binarymax.com
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
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 = 'http://example.com/';
// Put the event handlers somewhere in the code before the action of
// interest (opening the page in question or clicking something)
// http://phantomjs.org/api/webpage/handler/on-console-message.html
page.onConsoleMessage = function(msg, lineNum, sourceId) {
console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")');
};