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
// 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> |
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
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
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
// 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 |
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 historyCharts; | |
$(document).ready(function() { | |
var url; | |
url = $('#history-path').val(); | |
if (url.length > 0) { | |
$.ajax({ | |
url: url, | |
context: document.body | |
}).done(function(data) { |
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
/* 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 } |
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
-- 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 = |
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
{-# 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 |
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
-- 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 |
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
module Graph where | |
import qualified Data.Map as M | |
import qualified Data.Set as S | |
data Vertex v = | |
Vertex | |
{ vertexId :: Int | |
, vertexValue :: v | |
} |
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
<?php | |
$groupBy = function (array $items, callable $cb) { | |
return array_reduce($items, function ($acc, $item) use ($cb) { | |
$key = $cb($item); | |
$acc[$key][] = $item; | |
return $acc; | |
}, []); | |
}; |
OlderNewer