Skip to content

Instantly share code, notes, and snippets.

//in app.module.ts FormsModule -> ReactiveFormsModule
import { ReactiveFormsModule } from '@angular/forms';
imports: [
BrowserModule,
ReactiveFormsModule,
HttpModule
],
// in html
<form #userform = "ngForm" (ngSubmit) = "onSubmit(userform.value)">
<input name="first" ngModel required #first="ngModel">
<input type="text" placeholder="lastname" name="lastname" ngModel>
<select name="lang" ngModel>
<option value="a1">a1</option>
<option value="a2">a2</option>
//in app.component.ts
export class AppComponent {
title = 'app works!';
// Data array
todoListData = ["aaa", "bbb", "ccc"];
inputText = "";
// function
//in app.module.ts
import { RouterModule } from '@angular/router';
imports: [
BrowserModule,
FormsModule,
HttpModule,
RouterModule.forRoot([
{
path: 'member',
import serial
import time
ser = serial.Serial('/dev/tty.usbmodem1411', 9600)
time.sleep(1)
print ser.name
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup() {
//Initialize serial library for transmitting and receiving data via USB
Serial.begin(9600);
lcd.begin(16, 2); //define LCD Size 16 by 2
<?php
require 'vendor/autoload.php';
const DEFAULT_URL = 'https://phpdemoccc-sd27f.firebaseio.com/';
const DEFAULT_PATH = '/';
$firebase = new \Firebase\FirebaseLib(DEFAULT_URL);
// --- get data ---
$k1 = $firebase->get('/k1');
int number = 0 ;
void setup(){
Serial.begin(9600);
}
void loop(){
Serial.println(number);
number = number + 1;
delay(3000);
#include "SPI.h"
#include "MFRC522.h"
#define SS_PIN 10
#define RST_PIN 9
#define SP_PIN 8
MFRC522 rfid(SS_PIN, RST_PIN);
MFRC522::MIFARE_Key key;
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup() {
lcd.begin(16, 2); //define LCD Size 16 by 2
// lcd line 1