Skip to content

Instantly share code, notes, and snippets.

View freedomofkeima's full-sized avatar
❤️
Status: 200 OK

Iskandar Setiadi freedomofkeima

❤️
Status: 200 OK
View GitHub Profile
@freedomofkeima
freedomofkeima / mnist_beginner.py
Created February 2, 2016 08:00
TensorFlow Example for Beginners
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import os
import tensorflow.python.platform
import numpy
@freedomofkeima
freedomofkeima / mnist_expert.py
Created February 2, 2016 09:18
TensorFlow Example for Experts
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import os
import tensorflow.python.platform
import numpy
@freedomofkeima
freedomofkeima / failover_asg_lambda_to_slack.py
Last active March 16, 2020 09:48
Failover Script between Spot and On-demand ASG Instances (ECS Cluster Checking + Slack Notification)
#!/usr/bin/env python
# Lambda Script for spot instances failover
# NOTE 1: Re-failover from on-demand to spot will be done if all desired ECS tasks are currently running
# NOTE 2: The maximum number of spot instances is taken from its DesiredCapacity
# WARNING: You cannot increase DesiredCapacity of on-demand from the console without changing this script,
# however, you can increase DesiredCapacity of spot instances from the console and if it fails,
# this script will start on-demand instead of spot instances
#
import boto3
import json
@freedomofkeima
freedomofkeima / gist:a509775cbb4f5ce0d42cc4bd0009d7b5
Last active January 5, 2019 16:47
Number of followers vs total users in Github (Jan 5, 2019)
Followers, Number of user which has followers higher than or equal to
0,36468019
1,3975425
2,2104615
3,1429842
4,1082890
5,872123
6,728161
7,623424
8,543446
@freedomofkeima
freedomofkeima / gist:da3dbb691630f73bb41b8d012b959a92
Last active January 5, 2019 18:23
Number of repositories vs total users in Github (Jan 6, 2019)
Number of repositories, Number of user which has repositories higher than or equal to
0,36472511
1,15928613
2,9075049
3,6396362
4,4938517
5,4012281
6,3366805
7,2886263
8,2515052
@freedomofkeima
freedomofkeima / 2020_day_18.py
Last active December 8, 2021 09:01
Advent of Code 2020
result = 0
def new_calculate(line):
if '+' not in line and '*' not in line:
return int(line)
flatten = ""
idx = 0
ctx = 0
temp = ""
while len(line) > idx:
@freedomofkeima
freedomofkeima / day_8_2021.cpp
Created December 8, 2021 08:29
AoC Day 8 2021
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
string corrected_wires[] = {"abcefg", "cf", "acdeg", "acdfg", "bcdf", "abdfg", "abdefg", "acf", "abcdefg", "abcdfg"};
vector<string> build_wires(int config[]) {
@freedomofkeima
freedomofkeima / day_18_2021.cpp
Created December 18, 2021 17:45
AoC Day 18 2021
#include <stdio.h>
#include <iostream>
using namespace std;
inline string IntToString(int a){
char x[100];
sprintf(x,"%d",a); string s = x;
return s;
}
@freedomofkeima
freedomofkeima / main.py
Last active January 14, 2023 13:47
Extract GPSMAP data
import cv2
import numpy as np
import pafy
import pytesseract
TESSERACT_PARAMETERS = '--oem 3 --psm 6 -c tessedit_char_whitelist="Ckmtv0123456789.:"'
def cleanup_dist(dist: str) -> str: