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
-- Read in an hours file and print the total hours. | |
-- Hours file format: | |
-- Desc\tDate\tStartTime-EndTime | |
import System.Environment | |
import Data.List.Split | |
-- Return milliseconds | |
get_milliseconds :: [String] -> Double | |
get_milliseconds xs = hours + minutes | |
where |
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
import System.Environment(getArgs) | |
import Graphics.Rendering.Chart | |
import Data.Colour | |
import Data.Colour.Names | |
import Data.Default.Class | |
import Graphics.Rendering.Chart.Backend.Diagrams | |
import Graphics.Rendering.Chart.Axis.Floating | |
import Control.Lens | |
lifetime_discount = 0.05 |
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
function et_pb_get_content( textarea_id ) { | |
var content; | |
content = $( '#' + textarea_id ).val(); //Why not just use jquery in the first place, since you know, it actually works? | |
return content.trim(); | |
} | |
function et_pb_set_content( textarea_id, content ) { | |
$( '#' + textarea_id ).val( content ); | |
} |
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 <libxfce4panel/xfce-panel-plugin.h> | |
static void constructor(XfcePanelPlugin *plugin); | |
XFCE_PANEL_PLUGIN_REGISTER_INTERNAL(constructor); |
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
static void | |
constructor(XfcePanelPlugin *plugin) { | |
// Use any GTK_CONTAINER you wish, it will be packed into the XfcePanelPlugin (plugin) variable. | |
GtkWidget *scroll_win = gtk_scrolled_window_new(NULL, NULL); | |
/* Now program as if you were creating any old GTK application. */ | |
// Pack your container into the plugin's container. | |
gtk_container_add(GTK_CONTAINER(plugin), scroll_win); |
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/sh | |
main=enceladus # Change this to your plugin's name | |
gcc -Wall -shared -o lib${main}.so -fPIC ${main}.c `pkg-config --cflags --libs libxfce4panel-1.0` `pkg-config --cflags --libs gtk+-3.0` |
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
X-XFCE-Module=yourpluginname | |
X-XFCE-Module-Path=/usr/lib/xfce4/panel-plugins |
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 OverloadedStrings #-} | |
import Data.Csv | |
import Data.Fixed | |
import Data.Vector as Vec (Vector, fromList, sum, length, toList) | |
import Data.ByteString.Lazy as B (readFile) | |
import Control.Monad | |
import Control.Applicative | |
import System.Environment |
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
// Your test cases begin in here. | |
casper.test.begin("Reddit Top Links Tests", 1, function(test) { | |
// Your first test case starts here. | |
casper.start("http://reddit.com/", function() { | |
// In here, we have access to the website's (reddit's) DOM! | |
/* | |
So what we're doing is selecting all the entry links, | |
and then extracting their text, and then filtering | |
the link's text based on if they have the word "cat" | |
or not. |
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 OverloadedStrings #-} | |
import Network.HTTP.Conduit | |
import qualified Data.ByteString.Lazy as L | |
import qualified Data.ByteString as BS | |
import System.IO | |
import Data.Aeson | |
data CompilerStatus = CompilerStatus | |
{ |
OlderNewer