// jQuery
$(document).ready(function() {
// code
})| {% if craft.request.isAjax %} | |
| {% set layout = "_ajaxLayout" %} | |
| {% else %} | |
| {% set layout = "_layout" %} | |
| {% endif %} | |
| {% extends layout %} | |
| {% set limit = 10 %} | |
| {% set params = { section: 'news', limit: limit} %} |
| concat: { | |
| options: { | |
| // separator: '' | |
| }, | |
| colors: { | |
| options: { | |
| banner: 'var colors = ', | |
| footer: ';' | |
| }, | |
| files: { |
| <?php | |
| //Options | |
| $token = 'YOUR_TOKEN_HERE'; | |
| $domain = 'YOUR_SLACK_DOMAIN_GOES_HERE'; | |
| $channel = '#general'; | |
| $bot_name = 'Webhook'; | |
| $icon = ':alien:'; | |
| $message = 'Your message'; |
| <?php | |
| // (string) $message - message to be passed to Slack | |
| // (string) $room - room in which to write the message, too | |
| // (string) $icon - You can set up custom emoji icons to use with each message | |
| public static function slack($message, $room = "engineering", $icon = ":longbox:") { | |
| $room = ($room) ? $room : "engineering"; | |
| $data = "payload=" . json_encode(array( | |
| "channel" => "#{$room}", | |
| "text" => $message, |
| <?php | |
| // Get the entry | |
| $entry = craft()->entries->getEntryById(100); | |
| // Convert the existing data to what it would look like in POST | |
| $matrixData = array(); | |
| foreach ($entry->matrixField as $block) | |
| { |
#Introduction
Developing Chrome Extensions is REALLY fun if you are a Front End engineer. If you, however, struggle with visualizing the architecture of an application, then developing a Chrome Extension is going to bite your butt multiple times due the amount of excessive components the extension works with. Here are some pointers in how to start, what problems I encounter and how to avoid them.
Note: I'm not covering chrome package apps, which although similar, work in a different way. I also won't cover the page options api neither the new brand event pages. What I explain covers most basic chrome applications and should be enough to get you started.
| _.mixin({ | |
| // Get/set the value of a nested property | |
| deep: function (obj, key, value) { | |
| var keys = key.replace(/\[(["']?)([^\1]+?)\1?\]/g, '.$2').replace(/^\./, '').split('.'), | |
| root, | |
| i = 0, | |
| n = keys.length; |
This a working example based on the previous posted workflow.
Feedback is as always welcome.
Original project repository: Instagram-PHP-API