This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var GH = ['#EEEEEE', '#D6E685', '#8CC665', '#44A340', '#1E6823']; | |
var CO = ['#EF4B4D', '#F89B47', '#FAEA20', '#7DC242', '#5D94CE', '#855CA7']; | |
var graph = document.getElementsByClassName('js-calendar-graph-svg')[0]; | |
var days = [].slice.call(graph.getElementsByTagName('rect'), 0); | |
days.forEach(function(rect) { | |
switch(rect.getAttribute('fill').toUpperCase()) { | |
case GH[0]: rect.setAttribute('fill', CO[2]); break; // yellow | |
case GH[1]: rect.setAttribute('fill', CO[Math.floor(Math.random() * 2)]); break; // red || orange |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <time.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main (int argc, char *argv[]) { | |
time_t time_num[5] = {(time_t)0x00000000, (time_t)0x7fffffff, (time_t)0x80000000, (time_t)0xffffffff,}; | |
struct tm* parsed_time; unsigned int i; | |
printf("sizeof(time_t) is %lu.\n", sizeof(time_t)); | |
for (i = 0; i < 4; i++) { | |
parsed_time = gmtime(&(time_num[i])); |