Skip to content

Instantly share code, notes, and snippets.

Misbahul D Munir mdmunir

View GitHub Profile
View AlmanakController.php
<?php
namespace console\controllers;
/**
* Description of AlmanakController
*
* @author Misbahul D Munir <misbahuldmunir@gmail.com>
* @since 1.0
*/
View custom_delay.ino
void setup(void){
}
long t1=0,t2=0;
void loop(void){
if(t1 < millis()){
// kode di sini yang mau di delay
t1 = millis() + 3000; // delay tiap 3 detik
}
View arduinolog.c
/*
SD card read/write
This example shows how to read and write data to and from an SD card file
The circuit:
* SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)
View prependRow.js
function prependRow($e) {
var settings = $e.data('mdmTabularInput').settings;
var counter = settings.counter++;
var template = replace(settings.template, settings.replaces, counter);
var $row = $(template);
var $element = settings.container ? $e.find(settings.container) : $e;
var event = $.Event('beforeAdd');
$e.trigger(event, [$row]);
if (event.result !== false) {
@mdmunir
mdmunir / meeus.js
Created Nov 10, 2017
meeus algorithm
View meeus.js
This file has been truncated, but you can view the full file.
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
View tds.ino
#define TDS_SOURCE_1 2
#define TDS_SOURCE_2 3
float getTds() {
// konstanta diperoleh dari percobaan. Hasil dari fungsi ini dibandingkan dengan tds meter standar. Hasilnya diregresikan
// Baca README.md
float C1 = 27.0, C2 = 61.4; // <- dari regresi linier, mungkin berbeda tergantung nilai R yg dipakai. R=1K8 ohm
float x1, x2, ec;
int i;
@mdmunir
mdmunir / timer_hidroponik.ino
Created Aug 9, 2017
Timer untuk pompa hidroponik menggunakan arduino nano dan rtc 1307 serta keypad
View timer_hidroponik.ino
#include <Wire.h>
#include <RealTimeClockDS1307.h>
#include <EEPROM.h>
#include <Keypad.h>
//RealTimeClock RTC;//=new RealTimeClock();
#define SET_TIME 't'
#define SWITCH_ON '1'
#define SWITCH_OFF '0'
@mdmunir
mdmunir / ImageController.php
Last active Jul 9, 2017
Yii2 Tinymce widget
View ImageController.php
<?php
namespace app\controllers;
use Yii;
use mdm\upload\FileModel;
use yii\web\NotFoundHttpException;
use yii\imagine\Image;
use yii\helpers\FileHelper;
use yii\web\UploadedFile;
@mdmunir
mdmunir / index.php
Created May 22, 2017
Yii2 Angualjs Route
View index.php
<?php
use yii\web\View;
use dee\angularjs\NgRoute;
//use yii\helpers\Html;
/* @var $this View */
?>
<div ng-app="test">
View gist:6db95000c681be05877f72cdedd8c1a8
<?=
GridInput::widget([
'id' => 'detail-grid',
'allModels' => $model->items,
'model' => OrderItem::className(),
'columns' => [
['class' => 'mdm\widgets\SerialColumn'],
'product_id',
'qty',
[
You can’t perform that action at this time.