Skip to content

Instantly share code, notes, and snippets.

View sjehutch's full-sized avatar

scott hutchinson sjehutch

View GitHub Profile
@sjehutch
sjehutch / default.vcl
Created January 9, 2016 19:28
Varnish VCL Wordpress - 1. sudo cp /etc/varnish/default.vcl /etc/varnish/default.vcl.bak 2. sudo vi /etc/varnish/default.vcl
/* SET THE HOST AND PORT OF WORDPRESS
* *********************************************************/
backend default {
.host = "127.0.0.1";
.port = "8080";
@sjehutch
sjehutch / root.java
Created January 15, 2016 18:46
check for rooted device android class
/** @author Kevin Kowalewski */
public class RootUtil {
public static boolean isDeviceRooted() {
return checkRootMethod1() || checkRootMethod2() || checkRootMethod3();
}
private static boolean checkRootMethod1() {
String buildTags = android.os.Build.TAGS;
return buildTags != null && buildTags.contains("test-keys");
}
@sjehutch
sjehutch / main.js
Created January 18, 2016 17:00
Parse cloud code get average of SUM Rating
Parse.Cloud.define("getrating", function(request, response) {
//Query class appointments
var query = new Parse.Query("appointments");
//Query column trainer in appointments pass trainerid object
query.equalTo("trainer", request.params.trainerid);
query.find({
success: function(results) {
var sum = 0;
for (var i = 0; i < results.length; ++i) {
//Get the sum of the field rate for the trainer
@sjehutch
sjehutch / node-ec2-ubuntu-cluster
Created February 7, 2016 15:56 — forked from gflarity/node-ec2-ubuntu-cluster
Node+cluster on Amazon EC2 Quickstart
#First you'll need to Signup for AWS/EC2 and generate a key pair. Google it, there should be plenty of
#tutorials.
#Next, create an instance using the AWS Management Console and log into it using your key pair.
#You can find the AMI's here https://help.ubuntu.com/community/EC2StartersGuide
#I picked a 64bit 10.04 LTS AMI in US-East.
#Install node's perquisites (or those that aren't the default ubuntu LTS ami):
sudo apt-get update
sudo apt-get install build-essential libssl-dev
@sjehutch
sjehutch / pod install
Created February 24, 2016 21:05
podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'Parse', '~>1.11.0'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
@sjehutch
sjehutch / hockeyapp.sh
Created February 25, 2016 19:48
hockeyapp.sh
#!/usr/bin/env bash
# Remove this if you want deployment for every pull request.
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
echo "This is a pull request. No deployment will be done."
exit 0
fi
# This will only deploy if your main branch is develop.
if [[ "$TRAVIS_BRANCH" != "develop" ]]; then
@sjehutch
sjehutch / .travis.yml
Created February 25, 2016 19:54
travis.yml (android)
language: android
jdk: oraclejdk7
env:
matrix:
- ANDROID_TARGET=android-21 ANDROID_ABI=armeabi-v7a
sudo: required
android:
components:
@sjehutch
sjehutch / travis_upload_to_github.py
Created February 25, 2016 19:58
travis_upload_github
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import httplib
import urllib
import urlparse
import json
Executing tasks: [:Forcedroid:generateDebugSources, :Forcedroid:generateDebugAndroidTestSources, :forcedroid:libs:SalesforceSDK:generateDebugSources, :forcedroid:libs:SalesforceSDK:generateDebugAndroidTestSources]
Configuration on demand is an incubating feature.
WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.2 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.3 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.3 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-log
Executing tasks: [:forcedroid:libs:SalesforceSDK:generateDebugSources, :forcedroid:libs:SalesforceSDK:generateDebugAndroidTestSources, :forcedroid:generateDebugSources, :forcedroid:generateDebugAndroidTestSources]
Configuration on demand is an incubating feature.
WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.2 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.3 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-logging:commons-logging:1.1.3 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency commons-log