Skip to content

Instantly share code, notes, and snippets.

View teknosains's full-sized avatar

Budi K teknosains

View GitHub Profile
@teknosains
teknosains / home.php
Last active August 7, 2017 02:20
Header lazysizes
<div class="mdl-cell mdl-cell--8-col mdl-cell--12-col-tablet mdl-cell--12-col-phone mdl-grid mobile-cell-container">
<div class="mdl-shadow--2dp mdl-color--white mdl-cell mdl-cell--12-col art-container-pink">
<h2 class="h2-header"><a href="#" class="link-header">Latest</a></h2>
<ul class="mdl-list">
<?php if (isset($latest)) { foreach ($latest as $lt) { ?>
<li class="mdl-list__item mdl-list__item--two-line">
<a class="card-link" href="<?php echo site_url('read/' . $lt['slug']);?>">
<span class="mdl-list__item-primary-content">
<!--Add `lazyload` to the class & data-src=""-->
<img class="mdl-list__item-avatar list-avatar avatar-article lazyload" data-src="<?php echo $lt['img_thumbnail'];?>" alt="<?php echo $lt['title']?>">
@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 / 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 / content.html
Created January 29, 2018 02:40
Solving printing issue (with css styling) in Chrome and Firefox with Javascript
<div class="content">
<div style="background:#ddd">
<table style="height:200px"></table>
</div>
....
....
</div>
<script>
//add !important rule to every style found in each element
@teknosains
teknosains / response.php
Created October 26, 2018 08:19
Codeigniter Response Library
<?php if (!defined('BASEPATH')) { exit('No direct script access allowed'); }
/**
* Response utility
*
* @author budy
*/
class Response
{
private $obj = null;
@teknosains
teknosains / sample-menu-generator.php
Last active March 19, 2020 05:05
sample-menu-generator
<?php
class Menu extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('Menu_model');
}
<?php
class Menu_model extends CI_Model
{
public function fetchMenu($parent_id) {
return $this->db->select('*')
->from('menu')
->where('parent_id', $parent_id)
->get()->result_array();
}
<h3>List Menu</h3>
<span class="loading"></span>
<div id="menu">
<!--menu di render disini-->
</div>
<button type="button" id="logout">Logout</button>
<script src="<?php echo base_url('assets/js/jquery-3.4.1.min.js'); ?>"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<h3>Upload KTP-OCR</h3>
Recognize On the Fly
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<h3>Upload KTP-OCR</h3>
Recognize On the Fly