Skip to content

Instantly share code, notes, and snippets.

😋
Waw... bisa bikin status

Komputronika komputronika

😋
Waw... bisa bikin status
Block or report user

Report or block komputronika

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@komputronika
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
<?php
//--------------------------------
// Example usage:
//--------------------------------
print "<pre>";
print_r( functions_in_file(__FILE__) );
//--------------------------------
// Find functions in a file:
@komputronika
komputronika / save_screenshot_with_select.py
Created May 17, 2019 — forked from lantip/save_screenshot_with_select.py
Script untuk menyimpan tangkap-layar dari laman KPU, dengan terlebih dulu memilih TPS
View save_screenshot_with_select.py
# Sebagai kelanjutan dari script saya sebelumnya (save_screenshot.py)
# 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 selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from datetime import datetime
import time
@komputronika
komputronika / readme.md
Created Jan 9, 2019 — forked from nonsintetic/readme.md
PHP - Get YouTube subscriber count with Youtube API v3
View readme.md

How to:

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

  1. Go to https://console.developers.google.com/apis/library
  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
komputronika / firebase.php
Created Dec 7, 2018 — forked from krhoyt/firebase.php
Interact with Firebase from PHP.
View firebase.php
<?php
// Constants
$FIREBASE = "_YOUR_FIREBASE_URL_";
$NODE_DELETE = "temperature.json";
$NODE_GET = "temperature.json";
$NODE_PATCH = ".json";
$NODE_PUT = "temperature.json";
// Data for PUT
@komputronika
komputronika / user_ip_address.php
Created Nov 16, 2018
Get user's IP address with PHP
View user_ip_address.php
<?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 {
return $_SERVER['HTTP_X_FORWARDED_FOR'];
@komputronika
komputronika / GitHub-Forking.md
Created Jul 6, 2018 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow
View GitHub-Forking.md

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 git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

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

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@komputronika
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
//-------------------------------------
@komputronika
komputronika / auto_off.ino
Last active Apr 28, 2018
Sketch Arduino untuk Auto-off Baterai Menggunakan Relay
View auto_off.ino
/*
Sketch auto off baterai
menggunakan relay
Author: Komputronika.com
*/
// Definisi
You can’t perform that action at this time.