Skip to content

Instantly share code, notes, and snippets.

View Sensiblemnd's full-sized avatar

Rob Lloveras Sensiblemnd

View GitHub Profile
@Sensiblemnd
Sensiblemnd / consecutive_numbers
Last active August 31, 2018 17:53 — forked from XciA/consecutive_numbers
group consecutive numbers in array , in Javascript.
/*TODO MAKE IT IN ES6
var data=[4,5,6,9,10,14,15,20,21,22,23,24,25,30,31,34]
output
4-6,9-10,14-15,20-25,30-31,34
*/
var data=[4,5,6,9,10,14,15,20,21,22,23,24,25,30,31,34,36,37,94,95];
var start=data[0];
var temp=1;
var a=0;
@Sensiblemnd
Sensiblemnd / not.js
Last active May 30, 2018 15:28
Creates a function out of '!'.
//Creates a function out of '!'.
//Use this to improve code readability.
//Instead of... if (!loggedIn) {}
//..do this.. if not(loggedIn) {}
const not = value => !value;
/* ==========================================================================
These following classes can be used to add safe-area padding to the either 4 directions
========================================================================== */
.iphoneXSafeArea--top{
/* iOS 11.2+ */
padding-top: env(safe-area-inset-top);
/* iOS 11 */
@Sensiblemnd
Sensiblemnd / robot.js
Created December 11, 2012 20:03
ElGuapo
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);