Skip to content

Instantly share code, notes, and snippets.

// Highcharts CheatSheet Part 1.
// Create interactive charts easily for your web projects.
// Download: http://www.highcharts.com/download
// More: http://api.highcharts.com/highcharts
// 1. Installation.
// Highcharts requires two files to run, highcharts.js and either jQuery, MooTools or Prototype or the Highcharts Standalone Framework which are used for some common JavaScript tasks.
// <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
// <script src="https://code.highcharts.com/highcharts.js"></script>
@tnrn9b
tnrn9b / bash-cheatsheet.sh
Created September 4, 2016 08:43 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@tnrn9b
tnrn9b / chart-getdata.js
Created September 4, 2016 08:54
With Highstock JS v2.0.4 (2014-09-02)
var historyCharts;
$(document).ready(function() {
var url;
url = $('#history-path').val();
if (url.length > 0) {
$.ajax({
url: url,
context: document.body
}).done(function(data) {
@tnrn9b
tnrn9b / graph.js
Created September 4, 2016 08:59 — forked from TrevorBasinger/graph.js
/* jshint laxbreak: true, laxcomma: true */
(function (R, A) {
var mkSensorUrl = function (unit) { return 'http://10.50.2.213:8080/v2/units/' + unit + '/sensors'; },
mkChart = R.curry (function (el, label) {
return new Highcharts.Chart({ chart: { renderTo: el
, defaultSeriesType: 'line' }
, title: { text: 'Live '+label+' data' }
, xAxis: { type: 'datetime'
, tickLength: 1 }
@tnrn9b
tnrn9b / h99_p01_10.hs
Created September 15, 2016 15:43 — forked from yen3/h99_p01_10.hs
Practice for H-99: Ninety-Nine Haskell Problems( http://www.haskell.org/haskellwiki/H-99:_Ninety-Nine_Haskell_Problems )
-- Problem 1
myLast [] = error "empty list."
myLast [x] = x
myLast (x:xs) = myLast xs
-- Problem 2
myButLast x = head . drop 1 . reverse $ x
-- Problem 3
elementAt (x:xs) n =
@tnrn9b
tnrn9b / Snail.hs
Created March 9, 2017 03:51 — forked from tranma/Snail.hs
Relations, Graphs and Trees
{-# LANGUAGE TupleSections, FlexibleInstances #-}
-- Manipulate graphs for metadata generation
-- WARNING: everything in here is REALLY REALLY REALLY SLOW
--
module Snail
( Rel(..)
, fromList, toList
, allR, differenceR, unionR, composeR, transitiveR
, transClosure
@tnrn9b
tnrn9b / BuildGraph.hs
Created March 9, 2017 04:01 — forked from AndrasKovacs/BuildGraph.hs
Graph building code for SO question. See link in source.
-- http://stackoverflow.com/questions/24278006/need-advice-on-optimising-haskell-data-processing/
-- http://stackoverflow.com/questions/24344440/optimising-haskell-data-processing-part-ii
-- ****************** "Normal" version *****************************
import Data.Vector (Vector)
import qualified Data.Vector as V
import qualified Data.ByteString.Char8 as BS
import qualified Data.IntSet as IS
@tnrn9b
tnrn9b / graph.hs
Created March 9, 2017 04:53 — forked from YoEight/graph.hs
Stream based Graph processing example in Haskell
module Graph where
import qualified Data.Map as M
import qualified Data.Set as S
data Vertex v =
Vertex
{ vertexId :: Int
, vertexValue :: v
}
@tnrn9b
tnrn9b / groupBy.php
Created April 17, 2017 04:49 — forked from petemcfarlane/groupBy.php
php implementation of groupBy, which takes an array and a callback
<?php
$groupBy = function (array $items, callable $cb) {
return array_reduce($items, function ($acc, $item) use ($cb) {
$key = $cb($item);
$acc[$key][] = $item;
return $acc;
}, []);
};