Skip to content

Instantly share code, notes, and snippets.

View alexwebgr's full-sized avatar
😎

Alexandros alexwebgr

😎
View GitHub Profile
@alexwebgr
alexwebgr / gist:f1d76c5f7c0cf3103112066b08bd9f6e
Last active April 1, 2016 19:12
Concatenate consecutive characters followed by the number of characters if it is over 1
var input = 'aaaabbbbccccpqesrt';
var compressedString = '';
var s = input.match(/([a-zA-Z])\1*/g) || [];
s.forEach(function(value) {
var k = '';
if(value.length > 1) {
k = value.length;
}
compressedString += value.charAt(0) + k;
@alexwebgr
alexwebgr / gist:73ec7708b3433b5e534c
Created November 16, 2015 09:10
Force restart of date time widget on top bar ubuntu
pkill -f datetime
@alexwebgr
alexwebgr / world-topo.json
Created April 9, 2014 10:01
topoJson json file with country codes, capitals, longitude, longitude
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexwebgr
alexwebgr / Session.js
Last active September 26, 2022 14:21
Simple wrapper for localStorage
/**
* @author alexwebgr < https://github.com/alexwebgr >
* @desc the word 'Session' is used as a convention in order to avoid overriding
* the Storage or localStorage objects since localStorage is persisted in the browser
* even if the browser window closes or even the system restarts
* the only way to delete localStorage is manually
*/
var Session =
{