Skip to content

Instantly share code, notes, and snippets.

View bengchet's full-sized avatar

Ng Beng Chet bengchet

View GitHub Profile
@bengchet
bengchet / find_cam.py
Created November 6, 2019 23:08 — forked from kphretiq/find_cam.py
Identify Camera Device Linux
"""
#Installing v4l-utils (debian) gives one the handy v4l2-ctl command:
$ v4l2-ctl --list-devices
HPigh Definition Webcam (usb-0000:00:14.0-11):
/dev/video2
UVC Camera (046d:0821) (usb-0000:00:14.0-13):
/dev/video0
cat deploy | base64 | tr -d "\n" > deploy_b64
cat deploy_b64 | xclip -selection clipboard
import { Injectable } from '@angular/core';
import { Plugin, CordovaInstance, InstanceCheck, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
declare var cordova: any;
export interface ThemeableBrowserButton {
wwwImage?: string;
image?: string;
wwwImagePressed?: string;
@bengchet
bengchet / winstonLogger.js
Created December 29, 2017 03:18 — forked from nigilan/winstonLogger.js
Winston logger and daily rotator
/**
* Configurations of logger.
*/
const winston = require('winston');
process.env.NODE_ENV = "production";
const env = process.env.NODE_ENV;
const fs = require('fs');
var util = require('util');
const logDir = 'applicationlog';
@bengchet
bengchet / ttn-abp.ino
Last active September 14, 2017 09:20
/*******************************************************************************
* Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman
*
* Permission is hereby granted, free of charge, to anyone
* obtaining a copy of this document and accompanying files,
* to do whatever they want with them without any restriction,
* including, but not limited to, copying, modification and redistribution.
* NO WARRANTY OF ANY KIND IS PROVIDED.
*
* This example sends a valid LoRaWAN packet with payload "Hello,