Skip to content

Instantly share code, notes, and snippets.

View ragowthaman's full-sized avatar
🎯
Focusing

Gowthaman Ramasamy ragowthaman

🎯
Focusing
  • Seattle BioMed
  • Seattle WA USA
View GitHub Profile
@ragowthaman
ragowthaman / consultant.component.ts
Created October 23, 2017 18:58
Angular 4 Get Data from server via webserivce
getConsultantDataFromServer(){
this.DataWebService.getConsultantsFromServer().subscribe(data => {
this.data = data;
console.log(data);
this.dataSource = new MyDataSource(this.data, this.paginator, this.sort, this.firstname, this.lastname);
this.data_length = data.length;`
})
}
@ragowthaman
ragowthaman / 00-outer_originating_component.ts
Last active October 16, 2017 10:31
Passing data to incoming component via custom property binding
checked_ids: Array<number> = [40, 50];
@ragowthaman
ragowthaman / 00-outer_originating_component.ts
Last active October 16, 2017 10:34
Passing data to incoming component via ng-content
total: number = 0;
@ragowthaman
ragowthaman / 00-source_component.html
Last active October 16, 2017 10:31
Databinding via between components: Emitters: via service.ts
<i class="material-icons" (click)="setEditConsultant(element)">edit</i>
@ragowthaman
ragowthaman / file.css
Created October 13, 2017 07:04
Setup Side nav side tabs
/* START setup tabs in side nav*/
.nav-tabs li.active > a,
.nav-tabs li.active > a:hover,
.nav-tabs li.active > a:focus {
color: #555555;
cursor: default;
background-color: #ffffff;
border: 1px solid #ffffff;
border-bottom-color: transparent;
@ragowthaman
ragowthaman / list_consultants.html
Last active October 13, 2017 07:05
Display model data onto a template : URL -> Views(model) -> Template
{% extends "base_instance.html" %}
{% load i18n staticfiles %}
{% load templatetag_generic %}
{% block meta_title %}{% trans "Consultants" %}{% endblock %}
{% block title %}
{{ affiliation }} :
Consultant(s) List
{% endblock %}
@ragowthaman
ragowthaman / models.py
Created February 1, 2017 06:47
Create a webservice for BULK create
class Gyro(models.Model):
device = models.ForeignKey(Device)
ts = models.DateTimeField()
x = models.DecimalField(max_digits=18, decimal_places=18)
y = models.DecimalField(max_digits=18, decimal_places=18)
z = models.DecimalField(max_digits=18, decimal_places=18)
@ragowthaman
ragowthaman / models.py
Created November 23, 2016 06:11
Image upload via webservice Django/ionic
def get_resultfile_upload_destination(instance, filename):
return "complaint/00_generic/farmerid_{farmerid}/{file}".format(farmerid=instance.farmer.id, file=filename)
class Complaint(models.Model):
farmer = models.ForeignKey(Farmer)
file = models.FileField(blank=True, default='', upload_to=get_resultfile_upload_destination)
text = models.TextField(blank=True, default='')
timestamp = models.DateTimeField(auto_now=True)
@ragowthaman
ragowthaman / app.js
Created November 17, 2016 18:27
Django Webservice Angular Ionic App setup
.state('tab.referral-registration-form', {
url: '/register/referral/form',
views: {
'tab-dash': {
templateUrl: 'templates/dash-referral-registration/dash-referral_form.html',
controller: 'RegisterReferralFormCtrl'
}
}
})
.state('tab.referral-registration-ack', {
@ragowthaman
ragowthaman / views.py
Created August 2, 2016 18:41
send SMS from Django app Plivo
import plivo
def send_sms_plivo(to, message):
"""
Send message via plivo service 0.0037 USD/sms; only outgoing
:return:
"""
auth_id = "....."
auth_token="..........."