Skip to content

Instantly share code, notes, and snippets.

View epireve's full-sized avatar
🎯
Focusing on things that matter

Firdaus Adib epireve

🎯
Focusing on things that matter
  • Invoture Inc.
  • Liverpool, United Kingdom
View GitHub Profile
@nullifye
nullifye / UNDIMalaysia-PRU15.csv
Last active November 7, 2022 23:58
This CSV can be exported out of my web app https://nullifye.github.io/UNDIMalaysia/ (excepts for two columns namely 'pengundi berdaftar sebelum' and '% penambahan pengundi')
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 23 columns, instead of 22. in line 7.
kod,negeri,parlimen,dun,nama kawasan,jumlah calon,pengundi berdaftar,pengundi berdaftar sebelum,% penambahan pengundi,pengundi biasa,pengundi awal,pengundi tidak hadir luar negara,jumlah undi,tidak mengundi,undi bersih,undi tolak,majoriti,dimenangi,keluar mengundi,tidak mengundi / majoriti,undi tolak / majoriti,pilihan raya,tarikh
9,PERLIS,P.001,,PADANG BESAR,5,60192,46096,30.6%,57992,2191,9,,,,,,,,,,PRU KE-15 (2022),19 November 2022
9,PERLIS,P.001,N.01,TITI TINGGI,6,13403,10111,32.6%,13019,383,1,,,,,,,,,,PRU KE-15 (2022),19 November 2022
9,PERLIS,P.001,N.02,BESERI,4,12128,8914,36.1%,11793,330,5,,,,,,,,,,PRU KE-15 (2022),19 November 2022
9,PERLIS,P.001,N.03,CHUPING,3,14248,10542,35.2%,14247,,1,,,,,,,,,,PRU KE-15 (2022),19 November 2022
9,PERLIS,P.001,N.04,MATA AYER,3,9662,7617,26.8%,8182,1478,2,,,,,,,,,,PRU KE-15 (2022),19 November 2022
9,PERLIS,P.001,N.05,SANTAN,3,10751,8912,20.6%,10751,,,,,,,,,,,,PRU KE-15 (2022),19 November 2022
9,PERLIS,P.002,,KANGAR,5,74859,55938,33.8%,73837,1016,6,,,,,,,,,,PRU KE-15 (20
@nullifye
nullifye / pru15-candidates.json
Created November 6, 2022 05:49
Senarai calon PRU15 Malaysia / Candidates for Malaysia GE15
{
"P.001": {
"kod_negeri": 9,
"nama": "PADANG BESAR",
"calon": [{
"nama": "RUSHDAN BIN RUSMI",
"pekerjaan": "AHLI PERNIAGAAN",
"jantina": "L",
"kod_parti": "PN"
}, {
@TheBinitGhimire
TheBinitGhimire / README.md
Last active April 28, 2024 00:48
Getting an AWS Educate account with $100 worth of cloud credits!
@amalmurali47
amalmurali47 / backup_digitalocean.md
Last active June 18, 2024 15:53
Backup DigitalOcean droplet locally

DigitalOcean does not provide a way to download a snapshot of your droplet locally. You can use rsync to accomplish this instead.

On your local machine, assuming you have added your-server in your SSH config:

rsync -aAXHv --append-verify --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} your-server:/
  • -a : archive mode (all files, with permissions, etc.)
  • -A : preserve ACLs/permissions (not included with -a)
@henrych4
henrych4 / download_GoogleDrive.py
Last active January 17, 2024 04:02
A python script for downloading file in google drive
#Reference: https://stackoverflow.com/questions/38511444/python-download-files-from-google-drive-using-url
import requests
def download_file_from_google_drive(id, destination):
URL = "https://docs.google.com/uc?export=download"
session = requests.Session()
response = session.get(URL, params = { 'id' : id }, stream = True)
@pohzipohzi
pohzipohzi / forexfactory_econcal.py
Created November 3, 2017 15:35
A scraper for forex factory economic calendar data
from bs4 import BeautifulSoup
import requests
import datetime
import logging
import csv
def setLogger():
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s',
filename='logs_file',
@matsukaz
matsukaz / 01.README.md
Last active September 27, 2021 11:07
Find a geolocation of an IP address in BigQuery

This query is to find geolocation of an IP address including latitude, longitude, city and country.

Legacy SQL doesn't support range conditions such as BETWEEN when using JOIN, so we need to filter data by WHERE. This means if IP address does not match any of the data inside geolite_city_bq_b2b, records will not be able to receive.

Use Standard SQL if you want to receive records no matter you succeed to find geolocation or not.

Please refer to the following post for more detail.

https://cloudplatform.googleblog.com/2014/03/geoip-geolocation-with-google-bigquery.html

@SKempin
SKempin / Git Subtree basics.md
Last active June 27, 2024 07:56
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@antiboredom
antiboredom / transcribe.js
Last active November 22, 2019 01:26
Transcribe video/audio using IBM Watson
var request = require('request');
var fs = require('fs');
var sox = require('sox');
var spawn = require('child_process').spawn;
var WATSON_USER = '';
var WATSON_PASS = '';
var url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize';