Skip to content

Instantly share code, notes, and snippets.

View AriPal's full-sized avatar

Dler Ari AriPal

View GitHub Profile
@AriPal
AriPal / TestFacility.ino
Created October 24, 2014 08:15
I created this to show the whole code.
int ledPin1 = 6; // Red LED for FlameDetector sensor
int ledPin2 = 7; // Blue LED for PIR sensor
int PIR_sensor, Flame_Detector_sensor; // Assign two integers.
void setup()
{
Serial.begin(9600); // Communication rate
pinMode(ledPin1, OUTPUT); // Assign ledPin1 to output
pinMode(ledPin2, OUTPUT); // Assign ledPin2 to output
@AriPal
AriPal / PIR_sensor_normal.ino
Created October 24, 2014 08:20
Sensor monitoring..
int ledPin1 = 6; // led red
int ledPin2 = 7; // blue
int Flame_Detector_Sensor;
int PIR_sensor;
void setup()
{
Serial.begin(9600); // Communication rate
@AriPal
AriPal / TestFacility.ino
Created October 28, 2014 09:38
"TestSystem code for DoorSensor 28.10.14"
int ledPin1 = 6; // Red LED for FlameDetector sensor
int ledPin2 = 7; // Blue LED for PIR sensor
int PIR_sensor, Flame_Detector_sensor; // Assign two integers.
void setup()
{
Serial.begin(9600); // Communication rate
pinMode(ledPin1, OUTPUT); // Assign ledPin1 to output
pinMode(ledPin2, OUTPUT); // Assign ledPin2 to output
@AriPal
AriPal / TestFacility.ino
Created October 31, 2014 17:00
TestFacility Code
int ledPin1 = 6; // Red LED for FlameDetector sensor
int ledPin2 = 7; // Blue LED for PIR sensor
int PIR_sensor, Flame_Detector_sensor; // Assign two integers.
void setup()
{
Serial.begin(9600); // Communication rate
pinMode(ledPin1, OUTPUT); // Assign ledPin1 to output
pinMode(ledPin2, OUTPUT); // Assign ledPin2 to output
@AriPal
AriPal / app.js
Last active July 12, 2017 23:30
In short, I have defined my table in html file, then I use ajax with jQuery to retreive the html content with data from php file. I believe the problem has something to do with the timing, causing the table not to load properly.
updateTable: function(value){
$.ajax({
type: "GET",
url: "service.php?p=getRows",
success: function(tableData){
$('#adminView').html(tableData);
// alert(tableData);
}
});
}
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map, publishReplay, refCount } from 'rxjs/operators';
export interface Config {
componentType: string,
show: Boolean
}
import { from } from 'rxjs';
import { map, publishReplay, refCount } from 'rxjs/operators';
// Create observable that holds two values
const observable$ = from(['first', 'last']).pipe(
publishReplay(1),
refCount()
)
// Get configs from server | HTTP GET
getConfigs(): Observable<Config[]> {
// Cache it once if configs value is false
if (!this.configs) {
this.configs = Observable$.pipe(
// ... operators
publishReplay(1),
refCount()
);
// Clear configs
clearCache() {
this.configs = null;
}
var builder = new Builder<PlaneContext>();
builder.AddPlane(plane => plane.Name = "Boeng 720")
.AddClass(class => class.Name = "VIP")
.addPassenger(passenger => passenger.Name = "Bjørn Harald Vognhild-Olsen")
.addPassenger(passenger => passenger.Name = "John Doe")
.AddClass(class => class.Name = "Economy")
.addPassenger(passenger => passenger.Name = "Robert")
.addPassenger(passenger => passenger.Name = "Johanne");