Skip to content

Instantly share code, notes, and snippets.

View mdmunir's full-sized avatar

Misbahul D Munir mdmunir

View GitHub Profile
@mdmunir
mdmunir / AssetPublishBehavior.php
Last active January 6, 2021 01:46
Publish asset tanpa hash folder
<?php
namespace app\classes;
use Yii;
use yii\base\Behavior;
use yii\web\AssetManager;
/**
* Description of AssetPublishBehavior
@mdmunir
mdmunir / elp2000-82b.cpp
Created January 1, 2021 03:09
Full ELP 2000 82b
This file has been truncated, but you can view the full file.
T1 = (JD - 2451545) / 36525;
T2 = T1 * T1;
T3 = T2 * T1;
T4 = T3 * T1;
W = 3.810344430588308 + 8399.684731773914 * T1 - 0.000028547283984772807 * T2 + 3.201709550047375e-8 * T3 - 1.5363745554361197e-10 * T4;
L0 = 0;
L0 = L0 - 411.5956722539517 * Sin(3.255810466742936 + 16866.932316261078 * T1 - 0.0001187842000086474 * T2 - 9.899895368256725e-9 * T3 + 4.043346100453526e-11 * T4);
L0 = L0 + 0.4203253264023018 * Sin(6.511620933485872 + 33733.864632522156 * T1 - 0.0002375684000172948 * T2 - 1.979979073651345e-8 * T3 + 8.086692200907052e-11 * T4);
@mdmunir
mdmunir / debounce.js
Created May 18, 2020 21:55
Debounce Function Javasctipt
/**
* Execute a function given a delay time
*
* @param {type} func
* @param {type} wait
* @param {type} immediate
* @returns {Function}
*/
var debounce = function (func, wait, immediate) {
var timeout;
const PORT = process.env.PORT || 3001;
const STR_REGEX = 'socket\\-[a-z0-9]+';
var express = require('express');
var app = express();
var http = require('http').createServer(app);
var io = require('socket.io')(http, {
handlePreflightRequest: (req, res) => {
@mdmunir
mdmunir / my-vhost.conf
Created March 18, 2020 09:57
Apache + socket.io
<VirtualHost *:80>
ServerName dee-basic.test
Redirect permanent "/" "https://dee-basic.test/"
</VirtualHost>
<VirtualHost *:443>
ServerName dee-basic.test
DocumentRoot /var/www/dee-basic/web
gerhana 2 juli 2019
-------------------
jarak bulan-matahari = 152107000-372930 = 151734070 km
jari2 bumi = 6378 km
jari2 matahari = 695700 km
jari2 bulan = 1737.5 km
jarak bulan ke permukaan bumi = 372930-6378 = 366552 km
<?php
namespace app\controllers;
use app\classes\SSE;
use app\helpers\Notification;
use Yii;
use yii\web\Controller;
/**
/* File laramix/main.less */
@import '../node_modules/bootstrap/dist/css/bootstrap.css';
@import '../node_modules/admin-lte/dist/css/AdminLTE.css';
@import '../node_modules/admin-lte/dist/css/skins/_all-skins.css';
@import '../node_modules/font-awesome/css/font-awesome.css';
@import '../node_modules/admin-lte/plugins/iCheck/all.css';
@import 'css/app.less';
<?php
namespace app\widgets;
use Yii;
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\base\InvalidConfigException;
/**
@mdmunir
mdmunir / php-html-css-js-minifier.php
Created May 29, 2019 03:23 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
// Based on <https://github.com/mecha-cms/extend.minify>
define('MINIFY_STRING', '"(?:[^"\\\]|\\\.)*"|\'(?:[^\'\\\]|\\\.)*\'|`(?:[^`\\\]|\\\.)*`');
define('MINIFY_COMMENT_CSS', '/\*[\s\S]*?\*/');
define('MINIFY_COMMENT_HTML', '<!\-{2}[\s\S]*?\-{2}>');
define('MINIFY_COMMENT_JS', '//[^\n]*');
define('MINIFY_PATTERN_JS', '/[^\n]+?/[gimuy]*');
define('MINIFY_HTML', '<[!/]?[a-zA-Z\d:.-]+[\s\S]*?>');