Skip to content

Instantly share code, notes, and snippets.

View sjehutch's full-sized avatar

scott hutchinson sjehutch

View GitHub Profile
@sjehutch
sjehutch / fanscore-rating-algorithm
Last active August 29, 2015 14:27
fanscore-rating-algorithm
$zero = range (0);
$low = range(1, 99);
$high = 100;
case in_array($countReview, $zero):
$sum = 50;
case in_array($rateTotal, $log):
$sum = ($rateTotal / $countReview) * 10;
break;
case $rateTotal >= $high:
[
{
"playername": "Tony Romo",
"playerphoto": "uploads/5b398113-2e1b-4563-ba2c-c5462f1ebce5250.jpg",
"teamname": "Dallas Cowboys",
"teamid": "47",
"player_id": "c32d8200-2b85-4638-8db3-9a52fb86b207",
"playerid": "25982",
"lastscore": "up",
"abbr": "DAL",
[9/22/15, 2:09:09 PM] Aruljothi Kuppusamy: database public const int MAX_CONNCTION_COUNT = 150;
[9/22/15, 2:09:30 PM] Aruljothi Kuppusamy: the code automatically clear connection pool
[9/22/15, 2:10:02 PM] Aruljothi Kuppusamy: in DatabaseHandler.cs
[9/22/15, 2:12:53 PM] Aruljothi Kuppusamy: The server encountered an error processing the request. The exception message is 'Host '172.30.3.175' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts''. See server logs for more details. The exception stack trace is:
at MySql.Data.MySqlClient.MySqlStream.ReadPacket() at MySql.Data.MySqlClient.NativeDriver.Open() at MySql.Data.MySqlClient.Driver.Open() at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) at MySql.Data.MySqlClient.MySqlConnection.Open() at MySql.Data.MySqlClient.MySqlConnection.Open() at JLRServiceWS.DatabaseHandler..ctor() in c:\inetpub\wwwroot\JLR-WebServices\App_Code\Database\DatabaseHandler.cs:line 58 at JLRServiceWS.UserDetail..ctor() in c:\i
@sjehutch
sjehutch / addorder
Created October 29, 2015 19:53
adorer-func
public function addorder()
{
if ($this->request->is('post'))
{
//$order = array(3=>3,56=>2,87=>9);
//echo $this->request->data['orderData'] = json_encode($order);
$deliveryId = $this->request->data['deliveryId'];
$stripeCardId = $this->request->data['stripeCardId'];
$deliveryStartDate = $this->request->data['deliveryStartDate'];
$deliveryDate = $this->request->data['deliveryDate'];
{
"success":
true,
"winners":
[
{
"_id":
"56607eae079a73345abf6816",
"createdTime":
"2015-12-03T17:41:02.979Z",
@sjehutch
sjehutch / hangover.js
Created December 5, 2015 19:02
Hangover.js
#!/usr/bin/env node
/* Before running:
npm install twilio
*/
var exec = require('child_process').exec;
var me = 'my_username';
@sjehutch
sjehutch / travis.yml
Last active December 10, 2015 21:00
travis.yml android
language: android
android:
components:
- platform-tools
- tools
- build-tools-23.0.1
- extra-android-support
- extra-android-m2repository
- extra-google-google_play_services
- extra-google-m2repository
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import httplib
import urllib
import urlparse
import json
@sjehutch
sjehutch / main.js
Created January 7, 2016 22:24
parse cloud code
//Update location after appointment is saved
Parse.Cloud.afterSave("appointments", function(request, response) {
var locationClass = Parse.Object.extend("location");
var location = new locationClass;
location.set("location", request.object.get("location"));
location.set("client", request.object.get("client"));
location.set("trainer", request.object.get("trainer"));
location.save(null, {
success: function(location) {