Skip to content

Instantly share code, notes, and snippets.

View aoktox's full-sized avatar
🏠
Working from home

Agus Prasetiyo aoktox

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@aoktox
aoktox / Vagrantfile
Last active September 20, 2020 03:48
Vagrant multiple machine
$script = <<SCRIPT
echo "Installing python..."
apt-get update
apt-get install -y python-minimal
SCRIPT
SPECIALS = {
"master" => { :ip => "192.168.99.100", :ram => 1024 },
"hiddensecondary" => { :ip => "192.168.99.101", :ram => 512 }
}
@aoktox
aoktox / fancy_apt_install.sh
Last active November 2, 2018 08:10
Playing bash
#!/bin/bash
PACKAGES=(
"apr"
"gettext"
"libffi"
"openssl"
"apr-util"
"glib"
"libiconv"
"optipng"
@aoktox
aoktox / sholat-yuks.js
Created October 15, 2018 05:23
Bot Slack
function sendToSlack_(url,payload) {
var options = {
"method" : "post",
"contentType" : "application/json",
"payload" : JSON.stringify(payload)
};
return UrlFetchApp.fetch(url, options)
}
function getJadwalSholat() {
@aoktox
aoktox / loadImage.cpp
Created December 11, 2016 16:32
OpenCV
#include <cv.h>
#include <highgui.h>
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
Mat image;
image = imread("/home/agus/Desktop/FKN04K0HWTBIEL2.MEDIUM.jpg", CV_LOAD_IMAGE_COLOR);
@aoktox
aoktox / node.conf
Created October 8, 2016 21:44
Node w/ nginx
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://APP_PRIVATE_IP_ADDRESS:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
@aoktox
aoktox / addProduct.php
Created August 17, 2016 05:00
Insert and set attributes product woocommerce
<?php
/**
* Plugin Name: Insert Products
* Plugin URI:
* Description:
* Version: 1.04
* Author: Agus Prasetiyo
* Author URI:
* License: GPL2
* Created On:
@aoktox
aoktox / send.php
Created August 4, 2016 15:27
CURL Send data
$post_data['email'] = 'email@it.student.pens.ac.id';
$post_data['password'] = 'password';
//ubah array jadi data untuk posting (key1=value1)
foreach ( $post_data as $key => $value) {
$post_items[] = $key . '=' . $value;
}
//buat final string pake implode()
$post_string = implode ('&', $post_items);
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;