Skip to content

Instantly share code, notes, and snippets.

@akhmadkresna
akhmadkresna / gdrivelocal-mg-review-v2.html
Created August 31, 2026 23:28
gdrivelocal MG review v2 — 37 kinds (title/quote/diagram/callout/chapter/emphasis) + motion labels
This file has been truncated, but you can view the full file.
<!doctype html>
<html><head><meta charset="utf-8" />
<title>MG Review</title>
<style>
body { margin:0; background:#0c0c0b; color:#f5f4f1; font-family:-apple-system,'Segoe UI',sans-serif; padding:32px; }
h1 { font-size:20px; font-weight:600; margin:0 0 4px; }
.status { font-family:ui-monospace,Menlo,monospace; font-size:12px; color:#8f8c85; margin:0 0 24px; }
.status.has-failures { color:#e0674b; }
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(360px,1fr)); gap:20px; }
figure { margin:0; background:#141312; border:1px solid #333029; border-radius:8px; overflow:hidden; }
@akhmadkresna
akhmadkresna / gdrivelocal-mg-review.html
Created August 31, 2026 23:09
gdrivelocal MG overlay review (36 tiles)
This file has been truncated, but you can view the full file.
<!doctype html>
<html><head><meta charset="utf-8" />
<title>MG Review</title>
<style>
body { margin:0; background:#0c0c0b; color:#f5f4f1; font-family:-apple-system,'Segoe UI',sans-serif; padding:32px; }
h1 { font-size:20px; font-weight:600; margin:0 0 4px; }
.status { font-family:ui-monospace,Menlo,monospace; font-size:12px; color:#8f8c85; margin:0 0 24px; }
.status.has-failures { color:#e0674b; }
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(360px,1fr)); gap:20px; }
figure { margin:0; background:#141312; border:1px solid #333029; border-radius:8px; overflow:hidden; }
@akhmadkresna
akhmadkresna / index.html
Last active June 9, 2019 14:35
css/js typewriter
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="typedtext"></div>
<script src="script.js"></script>
</body>
</html>
sfdsfsfsdfsdfsf
@akhmadkresna
akhmadkresna / controller.py
Last active July 19, 2018 04:28
odoo route
# -*- coding: utf-8 -*-
import odoo.http as http
class your_class(http.Controller):
@http.route('/custom/url', type='http', auth='user', website=True)
def show_custom_webpage(self, **kw):
# render qweb template and parse another parameter data type dictionary, so we have 2 parameter in render method.
return http.request.render('your_module.new_web_page', {})
@akhmadkresna
akhmadkresna / web_page.xml
Created July 19, 2018 04:19
web page odoo
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- webpage record -->
<template id="new_web_page" name="Your page name" page="True">
<t t-call="website.layout">
<div id="wrap" class="oe_structure oe_empty">
<!-- Your content here -->
</div>
</t>
@akhmadkresna
akhmadkresna / odoo_website_filename.xml
Created July 8, 2018 14:29
odoo get file name from website
<div class="col-md-7 col-sm-8">
<input id="upload" type="file" class="form-control o_website_form_input" name="file" required=""/>
<input id="upload_name" type="text" class="form-control o_website_form_input" name="filename" required=""/>
</div>
<script>
$(function(){
$('#upload').change(function(e){
var fileName = e.target.files[0].name;
alert('The file "' + fileName + '" has been selected.');
$('#upload_name').val(fileName)
@akhmadkresna
akhmadkresna / odoo_filename.xml
Last active July 4, 2018 08:14
get file name of binary file
<!-- IN PYTHON, ADD ANOTHER FIELD DECLARATION TO STORE FILE NAME (CHAR)-->
file = fields.Binary("Attachment")
file_name = fields.Char("File Name")
<!-- IN XML VIEW, SET THE 'FILENAME' ATTRIBUTE OF THE BINARY FIELD WITH THE CHAR FIELD (FIELD_NAME)-->
<field name="file" filename="file_name"/>
<field name="file_name" invisible="1"/>
@akhmadkresna
akhmadkresna / odoo_seq.py
Created July 4, 2018 06:35
odoo sequence set via python code
class SaleDoc(models.Model):
_name = 'sale.doc'
name = fields.Char('No Dokumen')
tanggal = fields.Date('Tanggal')
sale_id = fields.Many2one('sale.order', string="Order")
keterangan = fields.Text('Keterangan')
file = fields.Binary('File Dokumen')
# Magic suppose to be happen in here. NOT BUGS
@akhmadkresna
akhmadkresna / odoo_sequence.xml
Last active July 4, 2018 07:22
create sequence odoo
<!-- Here i create sequence for model 'sale.doc' with prefix 'SK'. Padding is the length of increment number. padding 5 = 00001 -->
<!-- Later to be used in python code for running number of 'sale.doc' -->
<odoo>
<data noupdate="1">
<record id="seq_sale_doc" model="ir.sequence">
<field name="name">doc sequence</field>
<field name="code">sale.doc</field>
<field name="prefix">SK</field>
<field name="padding">5</field>
</record>