Skip to content

Instantly share code, notes, and snippets.

Avatar
☝️

Meirza Arson klanjabrik

☝️
View GitHub Profile
@klanjabrik
klanjabrik / README.MD
Last active Jul 6, 2020
Measuring Water Usage with NodeMCU +WaterFlow Sensor
View README.MD

esp layout single

PENDAHULUAN

Internet of Things yang bisa disebut dengan IoT menjadi bagian yang penting dalam kemajuan teknologi. Contohnya adalah dengan mengirimkan data penggunaan air dari sensor ke cloud sehingga bisa dengan mudah melihat hasilnya. Untuk mengirimkan data penggunaan air dari sensor ke cloud maka dibutuhkan internet. Sehingga jika berbicara tentang IoT maka kira berbicara tidak terlepas dari 2 hal, yaitu: sensor dan internet.

PERANGKAT KERAS YANG DIBUTUHKAN

  • NodeMCU Lua WiFi (Rp85.000)
  • Water Flow Sensor (Rp70.000)
  • Lampu LED (Rp350)
@klanjabrik
klanjabrik / settings.json
Created Jul 11, 2019
Pylint issue in Visual Studio
View settings.json
{
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.pythonPath": "<path to folder your python executable is in>",
"python.linting.pylintArgs": [
"--init-hook",
"import sys; sys.path.append('<path to folder your module/package is in>')"
]
}
@klanjabrik
klanjabrik / merge.sh
Last active May 14, 2019
Merge multi webm (audio) with FFMPEG
View merge.sh
ffmpeg \
-i input1.webm \
-i https://somewhere.com/input2.webm \
-filter_complex "[0:a][1:a]concat=n=2:v=0:a=1[aout]" -map "[aout]" \
-c:a libvorbis -strict experimental \
output.webm
# Notes: [0:a][1:a] and concat=n=2 is depending on number of inputs (-i)
# you can use libvorbis or libopus as codec
View waterflow.ino
// Credit:
// - https://diyhacking.com/arduino-flow-rate-sensor
// - http://www.instructables.com/id/Flowmeter-NodeMcu-Counting-Litres/
#include <Arduino.h>
#include <EEPROM.h>
#define USE_SERIAL Serial
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
View main.cpp
#include <iostream>
#include <Kucing.h>
int main() {
klanjabrik::takonKabar();
klanjabrik::Kucing jack;
jack.bicara();
return 0;
View Kucing.cpp
#include <iostream>
#include "Kucing.h"
namespace klanjabrik {
void takonKabar() {
std::cout << "Piye kabare, dab???" << std::endl;
}
Kucing::Kucing() {}
View Kucing.h
#ifndef Kucing_h
#define Kucing_h
namespace klanjabrik {
void takonKabar();
class Kucing {
public:
Kucing();
void bicara();
View gist:377e5f94f722be34adc4b54d873d6f27
(function (root, factory)
{
'use strict';
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if ( typeof exports === 'object' ) {
// Node/CommonJS
module.exports = factory();
@klanjabrik
klanjabrik / lsqrl.py
Last active Jul 28, 2016
Get latest version of repo at Github
View lsqrl.py
import sys
import getopt
from github import Github
from colored import fg, bg, attr
LONGSDESC = """
Usage: $python lsqrl.py sample.txt
content of file:
----------------
@klanjabrik
klanjabrik / gist:6473532
Last active Dec 22, 2015
Geoserver WMS: Tiled and SingleTile Layer
View gist:6473532
// Tiled Layer
the_layer = new OpenLayers.Layer.WMS(
"My Layer",
"http://localhost:8080/geoserver/merapi/wms",
{
layers: 'merapi:desa',
isBaseLayer: false,
tiled: true,
format: 'image/png',
tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom,
You can’t perform that action at this time.