Skip to content

Instantly share code, notes, and snippets.

View rizkiarm's full-sized avatar

Muhammad Rizki Aulia Rahman Maulana rizkiarm

View GitHub Profile
@rizkiarm
rizkiarm / model_loader_snippets.py
Created September 22, 2025 05:44
Snippet generators for serializing models (scikit-learn and PyTorch) into a copy-pasteable get_model() function string.
"""
Snippet generators for serializing models (scikit-learn and PyTorch) into a
copy-pasteable get_model() function string. The generated function is self-contained
and can be pasted into another file to reconstruct the model.
Features:
- Strong typing and clear APIs.
- Optional compression for smaller embedded payloads (zlib, gzip, bz2, lzma, none).
- For scikit-learn: uses pickle-compatible bytes (cloudpickle for dumping if available).
- For PyTorch: prefers TorchScript (self-contained), then full-model pickle with
FROM rizkiarm/tbp
MAINTAINER Muhammad Rizki A.R.M <rizki@rizkiarm.com>
# Download and setup libDAI
WORKDIR '/root/'
RUN wget https://staff.fnwi.uva.nl/j.m.mooij/libDAI/libDAI-0.3.2.zip && unzip libDAI-0.3.2.zip && rm libDAI-0.3.2.zip
WORKDIR '/root/libDAI-0.3.2'
RUN cp Makefile.LINUX Makefile.conf
RUN make
FROM clojure
RUN useradd -ms /bin/bash docker
RUN mkdir /src && chown docker:docker /src
USER docker
WORKDIR /src
RUN git clone https://bitbucket.org/probprog/anglican-user.git /src && lein deps
@rizkiarm
rizkiarm / Dockerfile.OSU
Created August 14, 2018 11:04
Dockerfile.OSU
FROM ubuntu:bionic
# Install dependencies
RUN apt update && apt install gnupg ca-certificates git wget fuse libglib2.0-0 -y
# Add docker user
RUN useradd -ms /bin/bash docker
# Install .NET Core
RUN apt-key adv --keyserver packages.microsoft.com --recv-keys EB3E94ADBE1229CF
@rizkiarm
rizkiarm / fix_virtualenv
Created June 26, 2018 11:37 — forked from tevino/fix_virtualenv
Fix python virtualenv after python update
#!/usr/bin/env bash
ENV_PATH="$(dirname "$(dirname "$(which pip)")")"
SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)"
BAD_ENV_PATHS="/usr/local"
echo "Ensure the root of the broken virtualenv:"
echo " $ENV_PATH"
@rizkiarm
rizkiarm / dockerenv
Created June 26, 2018 10:37
A simple virtual environment based on Docker
#/bin/bash
NAMESPACE=dockerenv-
NAME=$NAMESPACE$2
nargs="$#"
params_check(){
if test $nargs -ne $1; then
echo $2
@rizkiarm
rizkiarm / Dockerfile.conda
Last active June 26, 2018 11:12
Dockerfile of StarCraft2 and Conda based on NVIDIA image
FROM rizkiarm/nvidia-pysc2
MAINTAINER Muhammad Rizki A.R.M <rizki@rizkiarm.com>
################################################################################
# Lifted directly from Anaconda 3 Dockerfile:
# https://github.com/ContinuumIO/docker-images/blob/master/anaconda3/Dockerfile
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH
@rizkiarm
rizkiarm / BypassShSt.js
Created April 2, 2016 17:36
A javascript bookmarklet to bypass sh.st
// JSONP Lib: https://github.com/sobstel/jsonp.js
if(typeof app !== 'undefined'){
var $jsonp = (function(){
var that = {};
that.send = function(src, options) {
var callback_name = options.callbackName || 'callback',
on_success = options.onSuccess || function(){},
on_timeout = options.onTimeout || function(){},
@rizkiarm
rizkiarm / TEDPlaylistDownloader.js
Created April 2, 2016 17:33
A javascript bookmarklet which return list of video urls in a given TED playlist page.
var playlisted_n = 0;
var playlisted_i = 0;
var playlisted = [];
$('.banner,.nav__item').css('border-top','2px solid #fff');
$('.progress-playlist').remove();
$('body').append('<div class="progress-playlist" style="position: fixed;width: 100%;top: 0px;left: 0px;"><div style="background-color: #E62B1E;width: 0%;height: 2px;transition:width 0.5s;"></div></div>');
$('.playlist-talks__play.playlist-talks__thumb').each(function(){
playlisted_n++;
$.get($(this).attr('href'), function(data){
var targetScript;
@rizkiarm
rizkiarm / 0_reuse_code.js
Created February 4, 2014 08:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console