Skip to content

Instantly share code, notes, and snippets.

View notalentgeek's full-sized avatar

Mikael Kristyawicaksono notalentgeek

View GitHub Profile
@notalentgeek
notalentgeek / see_fm_arrange_numbering.py
Last active December 25, 2016 14:57
Python script to arrange numbering in my "see" folder.
# Python script to arrange files numbering in my personal see folder.
from tzlocal import get_localzone
import datetime as dt
import os
import shutil
import sys
def ArrangeFilesNumbering(_startDir):
# Get the list of files and folders in
@notalentgeek
notalentgeek / DetectChangeInTSecond.js
Last active January 10, 2017 23:26
JavaScript function to detect interval (1, 2, 3, ... seconds) using operating system internal clock.
// Function to detect if x second is already passed.
// If each tick is more than 1 second then this
// function is screwed, but that will not happen
// (hopefully).
function DetectChangeInTSecond(_t, _date){
this.t = _t;
this.currSecond = _date.getSeconds();
this.currSecondPrev = this.currSecond;
this.counter = 0;
@notalentgeek
notalentgeek / metis.css
Last active March 2, 2017 20:40
Basic MetisMenu style.
.sidebar-nav a,
.sidebar-nav a:active,
.sidebar-nav a:focus,
.sidebar-nav a:hover{
outline: none;
}
.sidebar-nav ul a,
.sidebar-nav ul li{
display: block;
}
@notalentgeek
notalentgeek / flight_api_puller.py
Last active May 10, 2023 23:22
Schipol Python Flight API Puller from https://developer.schiphol.nl/
"""
I faced a problem when pulling data from Schipol Airport API. The first
data pull is only resulted in 20 elements, meanwhile there are hundreds
of flights in Schipol everyday. From my support contact, it appears that
the API are in a pagination of 20 flights for each paginations.
This script is made to pull all flights schedule from all paginations.
"""
import requests, sys
@notalentgeek
notalentgeek / anyton.js
Created October 6, 2017 16:49
JavaScript Anyton (Singleton, Doubleton, X-ton)
var anyton = function (ton, parameters, init_count) {
if (!init_count) {
init_count = 1; // Singleton.
}
var instances = [];
this.create_instance = function () {
if (instances.length < init_count) {
instances.push(new ton(...parameters)); // No pun intended.