Skip to content

Instantly share code, notes, and snippets.

View jsakhil's full-sized avatar
🎯
Focusing

Js Akhil jsakhil

🎯
Focusing
View GitHub Profile
@jsakhil
jsakhil / flexbox.css
Last active March 14, 2020 05:29 — forked from brettsnippets/flexbox.css
Flexbox "Cross Browser" Sample
.content {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
Menu Odoo Support
..................................
path: /opt/odoo/odoo/addons/im_odoo_support/static/src/xml/im_odoo_support.xml
Menu Odoo Preferences, My Odoo.com account, About Odoo, Help, Log out
..................................
path: /opt/odoo/odoo/addons/web/static/src/xml/base.xml
Search for 'data-menu'
<?php
/**
* @license MIT
* @author Ruben Decleyn mukke@tbs-dev.co.uk>
* @created 12/02/2017
*/
namespace App\TwigExtensions;
Success Message: Message sent successfully!
Contact Us Auto Response
-------------------------
<p>Hi {{ forms_getField(input,'name') | raw }},</p>
<p>We have received your message, and we will contact you shortly!</p>
<p>Thanks!<br></p>
<p>AR Audio Medical</p>
Contact Us To Admin
@vovadocent
vovadocent / woo_commerce_usefull.php
Last active June 11, 2021 09:07
Woo Commerce Hooks and Tricks
<?php
////// Rename or remove order statuses //////
function wc_renaming_order_status($order_statuses) {
$order_statuses = array(
'wc-pending' => _x('Pending', 'Order status', 'woocommerce'),
'wc-processing' => _x('New Order', 'Order status', 'woocommerce'),
'wc-cancelled' => _x('Cancelled', 'Order status', 'woocommerce'),
'wc-completed' => _x('Approved', 'Order status', 'woocommerce'),
'wc-on-hold' => _x('On Hold', 'Order status', 'woocommerce'),
@strangerstudios
strangerstudios / my_pmpro_email_data.php
Created January 23, 2014 20:00
Add a !!todaysdate!! variable for use in Paid Memberships Pro email templates. Add this to your active theme's functions.php or a custom plugin and then include !!todaysdate!! in your email templates.
/*
Adds !!todaysdate!! as an available variable for use in Paid Memberships Pro emails.
Notice the array key does not include the !!s
*/
function my_pmpro_email_data($data, $email)
{
$data['todaysdate'] = date(get_option("date_format"));
return $data;
@jsakhil
jsakhil / pyro.twig
Last active January 22, 2022 20:15
PyroCMS
// Setting Value
{{ setting_value('streams::field_slug', config_get('streams::distribution.field_slug')) }}
// Content View
{{ page.content.render | raw}}
// Content Exerpt View
{{ page.content | striptags | slice(0, 120) }}
// Multiple File View
@sweetleon
sweetleon / ajax.autosave.naive.html
Last active April 14, 2022 09:48
naive AJAX auto-save implementation
<form method="POST" action="/our/url">
<textarea name="input" onChange="save(event)" />
</form>
<script language="javascript">
function save(event) {
var request = new XMLHttpRequest();
request.open(event.target.form.method, event.target.form.action);
request.send(new FormData(event.target.form));
}
<form method="POST" action="/our/url">
<!-- this should have the current value of version_number -->
<input type="hidden" name="version_number" value="1" />
<textarea name="input" onChange="save(event)" />
</form>
function save(event) {
event.target.form['version_number'].value++;
var request = new XMLHttpRequest();
Handlebars is a semantic web template system, started by Yehuda Katz in 2010.
Handlebars.js is a superset of Mustache, and can render Mustache templates in addition to Handlebars templates.
More: http://handlebarsjs.com/
1. Expressions.
1.1 Basic usage.