Skip to content

Instantly share code, notes, and snippets.

@psibi
psibi / index.html
Created April 2, 2014 19:52
Working jqplot with legends
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
<link href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.min.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
<link href="./jquery.jqplot.min.css" rel="stylesheet"
type="text/css" />
@psibi
psibi / tree.hs
Created June 17, 2014 02:05
Binary tree
import Control.Applicative
data Tree a = Leaf a
| Node (Tree a) (Tree a)
deriving Show
instance Functor Tree where
fmap f (Leaf a) = Leaf (f a)
fmap f (Node x y) = Node (fmap f x) (fmap f y)
@psibi
psibi / output
Created July 9, 2014 07:44
Cabal sandbox issue
$ cabal install -v3 --only-dependencies
Searching for ghc in path.
Found ghc at /usr/bin/ghc
("/usr/bin/ghc",["--numeric-version"])
/usr/bin/ghc is version 7.6.2
looking for tool ghc-pkg near compiler in /usr/bin
found ghc-pkg in /usr/bin/ghc-pkg
("/usr/bin/ghc-pkg",["--version"])
/usr/bin/ghc-pkg is version 7.6.2
("/usr/bin/ghc",["--supported-languages"])
@psibi
psibi / auctex
Created July 14, 2015 07:56
Aucex Error Message
Install package `auctex-11.88.6'? (y or n) y
Contacting host: elpa.gnu.org:80 [2 times]
Parsing tar file...done
Extracting auctex-11.88.6/
Extracting auctex-11.88.6/tex-site.el
Wrote /home/sibi/.emacs.d/elpa/auctex-11.88.6/tex-site.el
Extracting auctex-11.88.6/tests/
Extracting auctex-11.88.6/tests/latex/
Extracting auctex-11.88.6/tests/latex/latex-test.el
Wrote /home/sibi/.emacs.d/elpa/auctex-11.88.6/tests/latex/latex-test.el
@psibi
psibi / mockMigrationTest.hs
Created July 27, 2015 22:05
Mock Migration
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
import Control.Monad.IO.Class (liftIO)
@psibi
psibi / .fonts.conf
Created February 15, 2012 14:24
Fix Font rendering
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font" >
<edit mode="assign" name="rgba" >
<const>none</const>
</edit>
</match>
<match target="font" >
<edit mode="assign" name="hinting" >

The Ying-Yang of CEOs and Engineers

All successful startups begin with two founders. One guy is the Engineer, and the other guy is the business dude. Over the years of working with various people, I've learned what makes a good engineer, and what makes a good business dude, and the two are complete opposites of each other.

CEO Engineer
@psibi
psibi / index.html
Created October 22, 2012 15:12
Basic Template
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers map preview</title>
<!-- Import OL CSS, auto import does not work with our minified OL.js build -->
<link rel="stylesheet" type="text/css" href="http://localhost:8080/geoserver/openlayers/theme/default/style.css"/>
<!-- Basic CSS definitions -->
<style type="text/css">
@psibi
psibi / table.html
Created October 22, 2012 16:34
Build table using jQuery
var jobject = $(html_response_data);
$("caption.featureInfo",jobject).remove(); //Removing Caption tag
var mytable = "<table class=\"featureInfo\"><thead>";
var trs = $('tr',jobject);
trs.each(function(i,n) { //console.log($(n).html());
if (i==0) { mytable += $(n).html(); mytable += "</thead><tbody>";}
else { mytable += "<tr>"; mytable +=$(n).html(); mytable += "</tr>";}
});
mytable += "</tbody></table>";
$('#nodelist').html(mytable); //Put the table in the div whose id is "nodelist"
@psibi
psibi / popup
Created October 22, 2012 15:57
Popup
function setHTML(response){
document.getElementById('nodelist').innerHTML = response.responseText;
var popup_info = response.responseText;
if (popup != null) {
popup.destroy();
popup = null;
}
popup = new OpenLayers.Popup("Sample",
mouseloc,