Skip to content

Instantly share code, notes, and snippets.

View sjehutch's full-sized avatar

scott hutchinson sjehutch

View GitHub Profile
@sjehutch
sjehutch / updateprofileasync
Created January 24, 2017 23:23
Editprofileactivity
public class UpdateProfileAsync extends AsyncTask<Void, Void, Object> {
@Override
protected void onPreExecute() {
super.onPreExecute();
showDialog();
}
@Override
protected Object doInBackground(Void... voids) {
package com.provagroup.legit.ui.settings.profile;
import android.app.Dialog;
import android.app.PendingIntent;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
//setup address object
Map<String, Object> m = new HashMap<>();
m.put(WampApiFieldKeys.UA_TYPE, "home");
m.put(WampApiFieldKeys.UA_COUNTRY, "US");
m.put(WampApiFieldKeys.UA_STATE, "<state variable>");
m.put(WampApiFieldKeys.UA_CITY, "<city variable>");
// create new address list
List<Map<String, Object>> nadds = new ArrayList<>();
nadds.add(m);
client.call(proc, null, array, new ObjectNode(nc),
new Action1<Reply>() {
@Override
public void call(Reply arg0) {
list.add(arg0);
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable arg0) {
completed.set(true);
public class UpdateProfileAsync extends AsyncTask<Void, Void, Object> {
@Override
protected void onPreExecute() {
super.onPreExecute();
showDialog();
}
@Override
protected Object doInBackground(Void... voids) {
@sjehutch
sjehutch / bot.js
Created February 19, 2017 02:02 — forked from FireZenk/bot.js
Twitter bot using node.js and twit module to retweet interesting info of node.js
//
// Bot
// class for performing various twitter actions
//
var Twit = require('../lib/twitter');
var Bot = module.exports = function(config) {
this.twit = new Twit(config);
};
objc[1333]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x1132e4998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x113106880). One of the two will be used. Which one is undefined.
2017-03-22 00:18:21.237 NaturallySlim[1333:12807139] Firebase automatic screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable automatic screen reporting, set the flag FirebaseAutomaticScreenReportingEnabled to NO in the Info.plist
2017-03-22 00:18:21.434 NaturallySlim[1333:12807139] BuddybuildSDK : Disabled in the simulator
zendesk configured, appID: 61efcdd60fbca94cda931c6a1b73
@sjehutch
sjehutch / gist:93b41c9efe8c8898bc5f42bb426cd9b5
Created March 30, 2017 12:09
Bash Script HTTPD AWS EC2
#!/bin/bash
yum install httpd -y
yum update -y
service httpd start
chkconfig httpd on
echo "<html><h1>Hello Cloud !</h1></html>" > /var/www/html/index.html
@sjehutch
sjehutch / setup.py
Created May 5, 2017 01:45
setup.py
from flask import Flask, request
import json
import requests
import boto3
app = Flask(__name__)
ec2 = boto3.setup_default_session(region_name='us-east-1')
ec2 = boto3.resource('ec2')
@sjehutch
sjehutch / install.sh
Created May 21, 2017 14:24
install.sh golang
echo "Please enter your golang path (ex: $HOME/golang) :"
read gopath
echo "Please enter your github username (ex: vsouza) :"
read user
mkdir $gopath
mkdir -p $gopath/src/github.com/$user