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
This is much slower than a RegEx, however it handles commas inside of quoted string values. | |
sub ParseCSVLine($line) { | |
chomp($line); | |
@myChars = split(//, $line); | |
@myFields = (); | |
$newField = ""; | |
$inQuote = 0; |
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
<?php | |
// An simplified version of StatHat's own PHP code, wrapped in a class, with a lower timeout threshold. | |
class StatHat { | |
private static function ez_key() { | |
return "Your_StatHat_Key_Here" | |
//return $_SERVER['STATHAT_KEY']; | |
} | |
// StatHat's original code is very much _not_ asynchronous. | |
// In the event of DNS issues, this will lock your app for TIMEOUT seconds. |
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> | |
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script> | |
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.9.2/themes/cupertino/jquery-ui.css" /> | |
<style> | |
#list { |
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
<?php | |
/** | |
* Debug provides an API to save to common log file throughout the entire application | |
* All effort should be made to keep this file as portable to any application as possible | |
* | |
* Currently 4 levels of log entries exist: Errors, Warnings, Info, Trace. | |
* Errors = Conditions which occur and are possibly not recoverable from a user perspective. (i.e. Database will not connect) | |
* Warnings = Conditions which may not be favorable, but are recoverable. (i.e. Session information not available) | |
* Info = Any other information which does not indicate an issue to fix. (i.e. Early terminiation of script due to redirect) | |
* Trace = Position information and programmer fluff. These should be inserted during coding, and removed when done. (i.e. Entered function xyz() ) |
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
<?php | |
/** | |
* Match the following formats: | |
* mm/dd/yyyy | |
* m/d/yyyy | |
* mm/d/yyyy | |
* m/dd/yyyy | |
*/ | |
$date_regex = "/^(1[0-2]|0{0,1}[1-9])\/(3[0-1]|[0-2]{0,1}[1-9])\/[0-9]{4,4}$/"; |
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
#!/bin/bash | |
if [[ $# -lt 2 ]]; then | |
echo "$0 <file1> <file2> <file3> [file4]" | |
echo "This script is meant to run on 3 or more files, to see the changes over time." | |
exit 1 | |
fi | |
while [[ $# -ge 2 ]]; do | |
TEST=$(diff -q $1 $2) |
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
{ | |
// JSHint Default Configuration File (as on JSHint website) | |
// See http://jshint.com/docs/ for more details | |
"maxerr" : 50, // {int} Maximum error before stopping | |
// Enforcing | |
"bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.) | |
"camelcase" : false, // true: Identifiers must be in camelCase | |
"curly" : false, // true: Require {} for every new block or scope |
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
#!/bin/sh | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
brew install bash | |
brew install wget | |
brew install go | |
brew install node | |
brew install base64 | |
brew install git | |
brew install subversion |
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
function eachWithIdx(iterable, f) { var i = iterable.iterator(); var idx = 0; while (i.hasNext()) f(i.next(), idx++); } | |
function mapEach(iterable, f) { var vs = []; eachWithIdx(iterable, function (i) { vs.push(f(i));}); return vs; } | |
function escape(str) { | |
str = com.intellij.openapi.util.text.StringUtil.escapeXml(str); | |
return str; | |
} | |
function quote(str) { | |
return '"' + str + '"'; |
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
function eachWithIdx(iterable, f) { var i = iterable.iterator(); var idx = 0; while (i.hasNext()) f(i.next(), idx++); } | |
function mapEach(iterable, f) { var vs = []; eachWithIdx(iterable, function (i) { vs.push(f(i));}); return vs; } | |
OUT.append(JSON.stringify( mapEach(ROWS, function(row, row_idx) { | |
var r = {}; | |
eachWithIdx(COLUMNS, function(col, col_idx) { r[ col.name() ] = row.value(col); }); | |
return r; | |
}))); |
OlderNewer