Skip to content

Instantly share code, notes, and snippets.

@mlconnor
mlconnor / gist:4955479
Created February 14, 2013 19:18
JavaScript to parse a CSV string and create JSON objects based on the column headers
function csvToJson(str) {
var data = [], i = 0, k = 0, header = [];
var csvLines = CSVToArray(str);
for ( i = 0; i < csvLines.length; i++ ) {
var line = csvLines[i];
if ( i == 0 ) {
header = csvLines[i];
} else {
@mlconnor
mlconnor / Amazon_Connect_Pricing.csv
Last active September 30, 2021 14:48
A CSV version of the Amazon Connect pricing as of 9/30/2021
Country Claimed Number Per Day USD Claimed Number Per Day Toll Free USD Per Minute Inbound Inward Dial (DID) USD Per Minute Inbound Toll Free USD region
Argentina 0.50 0.50 0.01 0.19 us-east
Argentina 0.50 0.50 0.01 0.19 canada
Argentina 0.50 0.50 0.01 0.19 us-west
Australia 0.10 0.39 0.01 0.05 apac-singapore
Australia 0.10 0.39 0.01 0.05 apac-tokyo
Australia 0.10 0.39 0.01 0.05 eu-frankfurt
Austria 0.10 0.42 0.01 0.04 us-east
Austria 0.10 0.42 0.01 0.04 canada
Austria 0.10 0.42 0.01 0.04 apac-sydney
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Opinion Lexicon: Negative
;
; This file contains a list of NEGATIVE opinion words (or sentiment words).
;
; This file and the papers can all be downloaded from
; http://www.cs.uic.edu/~liub/FBS/sentiment-analysis.html
;
; If you use this list, please cite one of the following two papers:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Opinion Lexicon: Positive
;
; This file contains a list of POSITIVE opinion words (or sentiment words).
;
; This file and the papers can all be downloaded from
; http://www.cs.uic.edu/~liub/FBS/sentiment-analysis.html
;
; If you use this list, please cite one of the following two papers:
@mlconnor
mlconnor / bootstrap_index.html
Last active April 3, 2020 00:44
Bootstrap 3 CDN Template
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 3 Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap core CSS -->
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" media="screen">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
@mlconnor
mlconnor / aws_sdk_s3.php
Created January 15, 2013 18:33
Amazon AWS PHP 2 SDK S3 Example
<?php
// http://www.leofs.org/docs/s3_client.html
// i used composer with the following composer.json file and then called composer install
// {"require":{"aws/aws-sdk-php": "2.*"}}
require "vendor/autoload.php";
use Aws\Common\Enum\Region;
use Aws\S3\S3Client;
@mlconnor
mlconnor / elastic_beanstalk_memory.txt
Created January 9, 2014 21:51
Apache Tomcat Memory Settings for Elastic Beanstalk
My findings….
The Apache Web Server footprint will basically be
Apache Web Server Footprint = MaxClients * (Max Memory per Child)
Ryan found our current Apache settings for EB to be…
ServerLimit 256
MaxClients 256
@mlconnor
mlconnor / excel_spreadsheet.html
Created June 26, 2014 18:39
Spreadsheet Excel in 31 lines of code
<!DOCTYPE html>
<html>
<head>
<!-- fiddle is here http://jsfiddle.net/ondras/hYfN3 -->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Tiny Excel-like app in vanilla JS - jsFiddle demo by ondras</title>
<script type='text/javascript' src='/js/lib/dummy.js'></script>
@mlconnor
mlconnor / selenium_links.php
Last active June 18, 2018 13:47
Get all links with Selenium in PHP
@mlconnor
mlconnor / oembed_endpoints.js
Created April 24, 2013 12:45
List of oEmbed endpoints found here http://api.embed.ly/1/services
[{"regex": ["http://*youtube.com/watch*", "http://*.youtube.com/v/*", "https://*youtube.com/watch*", "https://*.youtube.com/v/*", "http://youtu.be/*", "http://*.youtube.com/user/*", "http://*.youtube.com/*#*/*", "http://m.youtube.com/watch*", "http://m.youtube.com/index*", "http://*.youtube.com/profile*", "http://*.youtube.com/view_play_list*", "http://*.youtube.com/playlist*"], "about": "YouTube is the world's most popular online video community, allowing millions of people to discover, watch and share originally-created videos. YouTube provides a forum for people to connect, inform, and inspire others across the globe and acts as a distribution platform for original content creators and advertisers large and small.", "displayname": "YouTube", "name": "youtube", "domain": "youtube.com", "subdomains": ["m.youtube.com"], "favicon": "http://c2548752.cdn.cloudfiles.rackspacecloud.com/youtube.ico", "type": "video"}, {"regex": ["http://*twitch.tv/*", "http://*justin.tv/*/b/*", "http://*justin.tv/*/w/*"], "about":