Skip to content

Instantly share code, notes, and snippets.


Komputronika komputronika

View GitHub Profile
komputronika / index.php
Created May 14, 2021 — forked from sheolseol/index.php
Simple Chat Using WebSocket and PHP Socket
View index.php
<!DOCTYPE html>
<meta charset='UTF-8' />
<style type="text/css">
.chat_wrapper {
width: 500px;
margin-right: auto;
margin-left: auto;
komputronika / Functions-in-file.php
Created Sep 9, 2019
Find all functions in a file and return it's names in array
View Functions-in-file.php
// Example usage:
print "<pre>";
print_r( functions_in_file(__FILE__) );
// Find functions in a file:
komputronika /
Created May 17, 2019 — forked from lantip/
Script untuk menyimpan tangkap-layar dari laman KPU, dengan terlebih dulu memilih TPS
# Sebagai kelanjutan dari script saya sebelumnya (
# Script ini membuka laman kpu, memilih berurutan Propinsi, Kabupaten, Kecamatan, Kelurahan dan TPS
# Di penghujung proses, dilakukan penyimpanan screenshot.
# Sebagai POC, saya batasi saja 5 TPS
from selenium import webdriver
from import By
from import WebDriverWait
from import expected_conditions as EC
from datetime import datetime
import time
komputronika /
Created Jan 9, 2019 — forked from nonsintetic/
PHP - Get YouTube subscriber count with Youtube API v3

How to:

Here's a 'simple' way to get the YouTube subscriber number from Google's Youtube API v3:

  1. Go to
  2. Log in with your Google account.
  3. Next to the logo click on 'Project' and 'Create project'. Name it whatever you want and click on 'Create'.
  4. Wait until the project is created, the page will switch to it by itself, it will take a couple of seconds up to a minute. Once it's done it will be selected next to the logo.
  5. Once it's created and selected, click on 'Credentials' from the menu on the left.
  6. Click on 'Create Credentials' and choose 'API Key'. You can restrict it to specific IPs, or types of requests (website, android, ios etc.) if you want, it's safer that way.
komputronika / firebase.php
Created Dec 7, 2018 — forked from krhoyt/firebase.php
Interact with Firebase from PHP.
View firebase.php
// Constants
$NODE_DELETE = "temperature.json";
$NODE_GET = "temperature.json";
$NODE_PATCH = ".json";
$NODE_PUT = "temperature.json";
// Data for PUT
komputronika / user_ip_address.php
Created Nov 16, 2018
Get user's IP address with PHP
View user_ip_address.php
function user_ip_address() {
if( array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ) {
if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')>0) {
$addr = explode(",",$_SERVER['HTTP_X_FORWARDED_FOR']);
$ip = filter_var(trim($addr[0]), FILTER_VALIDATE_IP)
return $ip;
} else {
komputronika /
Created Jul 6, 2018 — forked from Chaser324/
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

View gist:d0871abef1cf42537187f344639cffeb

1. Clone your fork:

git clone

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://
git fetch upstream
komputronika / multiButton.ino
Created Jun 5, 2018
Mendeteksi penekanan tombol ganda dengan Arduino
View multiButton.ino
// Mendeteksi Penekanan Tombol Ganda
// Semacam mendeteksi double klik, tapi bisa lebih dari 2 klik
// - Bisa mendeteksi jumlah tekanan berurutan pada button
// - Jumlah penekanan tidak terbatas (single, double, triple, dst)
// - Rentang waktu tekanan bisa diatur
// Author: Julius Chandra