Skip to content

Instantly share code, notes, and snippets.

View teknosains's full-sized avatar

Budi K teknosains

View GitHub Profile
@teknosains
teknosains / APDU Exmple.txt
Created February 26, 2023 17:15 — forked from JohnMcLear/gist:2d74f49849dd1c3382663cb3edf7217d
NFC-PCSC APDU based logic to get ID from various ISO14443 tags. Multos, Gemalto, Oberthur, ITSO, Oyster, Mifare, NTAG etc.
reader.on('card', async card => {
var uid = false;
// Smart card / payment ring / credit card / debit card
// Also Oyster etc.
if(card.type === "TAG_ISO_14443_4"){
// Trying GTO Credit / Debit card
var apdu = '80ca9f7f2c'; // Credit / Debit Card APDU
@teknosains
teknosains / joi-locale.ts
Created February 22, 2022 16:25 — forked from arifmahmudrana/joi-locale.ts
joi localization internationalization error messages
import { object, string, number, ValidationError } from '@hapi/joi';
const schema = object({
searchCode: string()
.required()
.label('Search code'),
id: number().required()
}),
messages = {
'alternatives.all': '{{#label}} does not match all of the required types',
@teknosains
teknosains / The Technical Interview Cheat Sheet.md
Created September 4, 2017 04:19 — forked from aditisonik01/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@teknosains
teknosains / index.html
Created August 9, 2017 08:31 — forked from Lakerfield/index.html
Print ZPL from browser
<!doctype html>
<html lang="en">
<head>
<title>Print ZPL from browser</title>
</head>
<body>
<h1>Test page for print ZPL from browser!</h1>
<script type="text/javascript">
function printZpl(zpl) {
@teknosains
teknosains / LSA.py
Created June 14, 2017 10:26 — forked from vgoklani/LSA.py
Latent Semantic Analysis (LSA) [simple example]
#!/usr/bin/python
# reference => http://www.puffinwarellc.com/index.php/news-and-articles/articles/33.html
from numpy import zeros
from scipy.linalg import svd
from math import log # needed for TFIDF
from numpy import asarray, sum
titles = ["The Neatest Little Guide to Stock Market Investing",
@teknosains
teknosains / MY_Security.php
Last active November 19, 2020 20:30 — forked from CMCDragonkai/MY_Security.php
PHP: Codeigniter CSRF functionality does not support putting the CSRF token in the HTTP headers for the purposes of the double submit cookie method. It also only runs the CSRF check on POST and not on PUT or DELETE. This drop in MY_Security.php makes sure CSRF runs on POST, PUT or DELETE and checks the HTTP headers for X-XSRF-TOKEN recommended b…
<?php
class MY_Security extends CI_Security{
//overriding the normal csrf_verify, this gets automatically called in the Input library's constructor
//verifying on POST and PUT and DELETE
public function csrf_verify(){
//attach to global POST variable
//this will catch any method POST, PUT, DELETE