Skip to content

Instantly share code, notes, and snippets.

View nirlanka's full-sized avatar

Nir Lanka nirlanka

  • SGX
  • Singapore
View GitHub Profile
<form [formGroup]="addFriendForm" (ngSubmit)="send()">
<div>
<label>Name</label>
<input type="text" formControlName="name">
</div>
<div>
<label>Email</label>
<input type="text" formControlName="email">
</div>
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
// Component code:
addFriendForm: FormGroup;
private _user = {
name: 'Amarabandu Rupasingha',
email: 'user1@mail.com',
};
...
USB 3.0 Bus:
Host Controller Driver: AppleUSBXHCISPTLP
PCI Device ID: 0x9d2f
PCI Revision ID: 0x0021
PCI Vendor ID: 0x8086
HUAWEI Mobile:

➜ ~ lsusb

Bus 020 Device 037: ID 12d1:1506 Huawei Technologies Co., Ltd. HUAWEI Mobile 
Bus 000 Device 001: ID 1d6b:PTLP Linux Foundation USB 3.0 Bus 
Bus 000 Device 001: ID 1d6b:CIAR Linux Foundation USB 3.1 Bus 
## dongle.conf
DefaultVendor=0x12d1
DefaultProduct=0x1505
TargetVendor=0x12d1
TargetProductList="140b,140c,1506,150f,150a"
HuaweiNewMode=1
@nirlanka
nirlanka / app.js
Created November 12, 2018 14:12 — forked from aosteraas/app.js
TeamCity Discord Bot
#!/usr/bin/env node
const Discord = require('discord.io');
const teamcity = require('teamcity');
const auth = require('../auth.json');
// Create Discord Bot
const bot = new Discord.Client({
token: auth.token,
autorun: true
});
@nirlanka
nirlanka / custom.css
Last active November 12, 2018 15:58
IEEE Wordpress template modifications
/*
----------------------
NAVBAR
*/
/* hide the comsoc logo */
.comsoc-logo {display: none;}
#logos {
/*background-image: url(http://sites.ieee.org/r10-htc-2018/files/2018/02/logo1.png);
@nirlanka
nirlanka / convert.py
Last active April 1, 2019 12:14
Drag .docx/.md file into this file to convert it to the other type!
### Requires Pandoc.
### Install this using `choco install pandoc`
###
import sys
import subprocess
def log(txt):
outfile = open('convert.log.txt', 'a')
print(txt)
@nirlanka
nirlanka / mobileconfig.json
Created April 9, 2019 08:53
MicroBuild Management Mobile - test 1
{
"//0.0.1": "http://localhost:59659/",
"0.0.1": "http://192.168.137.1:59659/"
}
@nirlanka
nirlanka / click-to-copy-cell.js
Created May 13, 2019 12:55
Click to copy text (from table cell) in HTML with pure Javascript
const copyToClipboard = str => {
const el = document.createElement('textarea');
el.value = str;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
};
document.addEventListener('click', (e) => {