This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a Python script that let you arrange | |
# files into a folder for each extension. Actually | |
# I lied, this script is not about file extension | |
# but about a file's mime type. So, in case there | |
# are files that has no extension this script can | |
# predict what the file's extension could be. | |
# However, the only requirement is that file need | |
# to be able to be read by the computer's OS. For | |
# example image files usually has no problem with | |
# this script also with other media files. But, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a Python script to mass add same | |
# extension for all files in a folder. | |
import os | |
import shutil | |
import sys | |
def MassAddSameExtension(_targDir, _ext): | |
# Get the list of all files in the targetDirectory. | |
targDirList = os.listdir(_targDir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Only works with operating system that uses | |
# AlsaAudio as audio driver. Most Linux distros | |
# are using this (Debian, Ubuntu). Does not work | |
# any where else (MacOS or Windows). | |
# | |
# This is a class to stream audio data from | |
# computer microphone then extract the pitch | |
# and the volume from it. This is done using | |
# AlsaAudio and Aubio Python library. The | |
# AlsaAudio is used to turn on the computer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a simple demonstration on how to stream | |
# audio from microphone and then extract the pitch | |
# and volume directly with help of PyAudio and Aubio | |
# Python libraries. The PyAudio is used to interface | |
# the computer microphone. While the Aubio is used as | |
# a pitch detection object. There is also NumPy | |
# as well to convert format between PyAudio into | |
# the Aubio. | |
import aubio | |
import numpy as num |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a Python script to initiate notes with all images. | |
# Images are all already re - sized into 600 pixel width with | |
# proportional height. First is that I need to get the directory | |
# that is filled with the notes I want to init. | |
import datetime as dt | |
import io | |
import os | |
import shutil | |
import subprocess |
NewerOlder