Skip to content

Instantly share code, notes, and snippets.

View RichLogan's full-sized avatar

Rich Logan RichLogan

  • London, UK
  • 02:36 (UTC)
View GitHub Profile
@RichLogan
RichLogan / yum-development-tools.sh
Created December 17, 2015 11:08
yum-development-tools
yum install bison byacc cscope ctags cvs diffstat doxygen flex gcc gcc-c++ gcc-gfortran gettext git indent intltool libtool patch patchutils rcs redhat-rpm-config rpm-build subversion swig systemtap
@RichLogan
RichLogan / .bash_profile
Created October 13, 2015 12:35 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
"AU",31
"AT",10
"IL",2
"BS",1
"BE",6
"BR",36
"CA",28
"CL",1
"CN",24
"CK",1
gunicorn justHealthServer:app --error-logfile logs.txt --certfile=certificate.crt --keyfile=newPrivateKey.pem -b 0.0.0.0:5000 --ssl-version=3
@RichLogan
RichLogan / build.gradle
Last active August 29, 2015 14:13
JustHealth Gradle Build file
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "justhealth.jhapp"
minSdkVersion 10
targetSdkVersion 21
Context context = getApplicationContext();
CharSequence text = "TEXT HERE";
//Length
int duration = Toast.LENGTH_LONG;
Toast toast = Toast.makeText(context, text, duration);
//Position
toast.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 100);
//Background Color
//toast.getView().setBackgroundColor(Color.RED);
toast.show();
###Patient/Carer Homescreen
###Account Deactivation
1. Deactivate their account and not be able to log in
2. Choose between erasing all data or keeping
#####Details Kept
######Web
1. Register a test account
@RichLogan
RichLogan / gist:5909bc2756b442bf5d93
Created November 6, 2014 13:28
Get logged in Android user
// To Get
SharedPreferences account = getSharedPreferences("account", 0);
String username = account.getString("username", null);
//To Set
SharedPreferences account = getSharedPreferences("account", 0);
SharedPreferences.Editor edit = account.edit();
edit.putString("username", InsertUsernameHere);
edit.commit();
@RichLogan
RichLogan / smtp.py
Created May 8, 2014 18:30
Python SMTP Snippet
sender = '"NAME" <[email protected]>'
recipient = '"NAME" <[email protected]>'
subject = "Subject"
message = ""
server = smtplib.SMTP('smtp.server.com')
m = "From: %s\r\nTo: %s\r\nSubject: %s\r\nX-Mailer: YOUR_APPLICATION_URL\r\n\r\n" % (sender, recipient, subject)
server.sendmail(sender, recipient, m+message)
server.quit()
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.get( "http://playpaloalto.com/api/v1/login", { "username": "[email protected]", "password": "1" } ).done(function( data ) {
alert("Data Loaded: " + data['message']);
});
});