Skip to content

Instantly share code, notes, and snippets.

View catwhocode's full-sized avatar

Cat who code catwhocode

  • Jakarta, Indonesia
  • 21:35 (UTC +07:00)
View GitHub Profile
@catwhocode
catwhocode / unserialize-php-session.py
Last active August 7, 2016 12:14 — forked from scragg0x/gist:3894835
Unserialize PHP Session in Python
def unserialize_session(val):
if not val:
return
session = {}
groups = re.split("([a-zA-Z0-9_]+)\|", val)
if len(groups) > 2:
groups = groups[1:]
groups = map(None, *([iter(groups)] * 2))
for i in range(len(groups)):
@catwhocode
catwhocode / cherryd.py
Created October 1, 2015 04:51 — forked from dbinit/cherryd.py
CherryPy Django server
import os
import socket
import urllib
import urlparse
import cherrypy
# Django settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
# Celery loader
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@catwhocode
catwhocode / perkalian_matriks.php
Last active December 16, 2020 07:15 — forked from f2face/perkalian_matriks.php
[PHP] Fungsi Perkalian Matriks
<?php
/* Fungsi perkalian matriks
* @f2face - 2013
*/
function kalikan_matriks($matriks_a, $matriks_b) {
$hasil = array();
for ($i = 0; $i < sizeof($matriks_a); $i++) {
for ($j = 0; $j < sizeof($matriks_b[0]); $j++) {
$temp = 0;
' http://web.archive.org/web/20060527094535/http://www.nonhostile.com/howto-encode-decode-base64-vb6.asp
' http://cwestblog.com/2013/09/23/vbscript-convert-image-to-base-64/
Public Function ConvertFileToBase64(strFilePath As String) As String
Const UseBinaryStreamType = 1
Dim streamInput: Set streamInput = CreateObject("ADODB.Stream")
Dim xmlDoc: Set xmlDoc = CreateObject("Microsoft.XMLDOM")
Dim xmlElem: Set xmlElem = xmlDoc.createElement("tmp")
Bridging Kamar BPJS 2021 Implementasi Bridging di RSUD ALIHSAN
Ketersediaan Kamar
#Monitoring Hasil bridging Live Production
https://faskes.bpjs-kesehatan.go.id/aplicares/#/app/dashboard
#Base Url
Development: https://dvlp.bpjs-kesehatan.go.id:8888/
Production: https://new-api.bpjs-kesehatan.go.id/
#Referensi Kamar
@catwhocode
catwhocode / NaiveBayes.py
Created February 19, 2022 06:42 — forked from tuttelikz/NaiveBayes.py
Naive Bayes From Scratch in Python
#How To Implement Naive Bayes From Scratch in Python
#http://machinelearningmastery.com/naive-bayes-classifier-scratch-python/
#Dataset
#https://archive.ics.uci.edu/ml/machine-learning-databases/pima-indians-diabetes/pima-indians-diabetes.data
import csv
import math
import random
#Handle data
# [CONFIGURATION]
# Ensure WSL2 container is started and SSH is running
wsl sudo /etc/init.d/ssh start
# Ports to be forwarded
$ports = @(22) + @(6543,6544) + @(6800..6810);
# Change $addr to restrict connections to a particular interface IP
$listen_addr = '0.0.0.0';
@catwhocode
catwhocode / google-apps-script.md
Created April 5, 2022 08:01 — forked from labnol/google-apps-script.md
How to Learn Google Apps Script

Learning Google Apps Script

Find the best resources for learning Google Apps Script, the glue that connects all GSuite services including Gmail, Google Drive, Calendar, Google Sheets, Forms, Maps, Analytics and more.

A good place to learn more about Google Apps Script is the official documentation available at developers.google.com. Here are other Apps Script resources that will help you get up to speed.

  1. Google Apps Script Code Samples by Amit Agarwal
  2. Google Apps Script Development - Create Google Apps Script projects locally inside VS Code - video tutorial
  3. Awesome Google Scripts by Amit Agarwal
  4. Google Developer Experts - Follow Apps Scr
@catwhocode
catwhocode / createcertificate.php
Created April 10, 2022 09:02 — forked from jlainezs/createcertificate.php
Creates a certificate using OpenSSL with PHP. sing.php could be used to sign a text with the pkey generated with createCertificate. verify.java shows how to load the certificate from a resource and a verification sample of the text signed with sign.php
/**
* Creates an OpenSSL certificate
* @param $dn Array Associative array "key"=>"value"
* @param $duration int Number of days which the certificate is valid
* @throws Exception If there are any errors
* @return Array Associative array with the security elements: "cer"=>self signed certificate, "pem"=>private key, "file"=>path to the files
*
* @see http://www.php.net/manual/en/function.openssl-csr-new.php
* @author Pep Lainez
*/