This file contains 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
open Core.Std | |
let rec sum l = | |
match l with | |
| [] -> 0 | |
| hd :: tl -> hd + sum tl | |
let divide x y = | |
if y = 0 then None else Some (x/y) |
This file contains 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 casper = require('casper').create(); | |
var home_url = "https://applications2.almullagroup.com/onlineremit/faces/infrastructure/EXLogin.jspx"; | |
var rate; | |
var sparkfun_url = "https://data.sparkfun.com/input/XCVB?private_key=ABCD&INR=" | |
casper.start(home_url); | |
casper.waitForSelector("form#form1"); |
This file contains 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 java.sql.*; | |
public class FirstExample { | |
// JDBC driver name and database URL | |
static final String JDBC_DRIVER = "com.mysql.jdbc.Driver"; | |
static final String DB_URL = "jdbc:mysql://172.22.32.201/site"; | |
// Database credentials | |
static final String USER = "db_user"; | |
static final String PASS = "db_pass"; |
This file contains 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
{ | |
"status": "success", | |
"product_delivery_messages": { | |
"1294420": "Same Day Delivery", | |
"1294427": "Next Day Delivery" | |
}, | |
"product_delivery_methods": { | |
"1294420": [ | |
{ | |
"value": "standard_delivery", |
This file contains 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
angular.module("xciteServices", []) | |
.factory('CartService', function() { | |
// Factory for Cart Items | |
var cartItems = angular.copy(window.Globals.CartItems); | |
return { | |
// private function to find item with itemId | |
_findItem: function(itemId) { | |
var index = -1; | |
for (var i in cartItems) { | |
if (cartItems[i].id === itemId) { |
This file contains 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
filename=$1 | |
for hour in {0..23} | |
do | |
for minute in {0..59} | |
do | |
if [ $hour -lt 10 ] | |
then | |
h="0$hour" | |
else |
This file contains 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
#!/usr/bin/python2.7 | |
import re | |
from collections import Counter | |
import sys | |
def do_analysis(data): | |
date_map = dict() | |
for l in data: |
This file contains 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.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
watch: { | |
files: ['**/*.js', '**/*.html'], | |
options: { | |
// Start a live reload server on the default port 35729 | |
livereload: true, |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Test Suite!</title> | |
<style> | |
li.pass { background: green; | |
color: white;} | |
li.fail { background: red; color: white;} | |
ul#results ul { margin-bottom: 10px;} |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Test Suite!</title> | |
<style> | |
li.pass { background: green; | |
color: white;} | |
li.fail { background: red; color: white;} | |
ul#results ul { margin-bottom: 10px;} |