Everything built on top of the base OpenClaw platform. Canonical reference for what exists, where it lives, and how it works. Operational use cases and workflow playbooks live in
docs/USE-CASES-WORKFLOWS.md.
I decided to share this snippet based on seeing what others were doing in this thread: https://www.reddit.com/r/homeassistant/comments/emvk9y/how_do_you_monitor_sensor_battery_levels_looking/
Basically dome device types of battery report the state in different locations and with different string
values that the change node or conditional logic just doesn't work nicely. Using the conditional logic on
this string state value might not be working fully how we think it is or at least didn't for me. When I was
debugging it and getting 10 outputted in a 100 bucket via the gt condition. The best way I've found to
handle these conditions is with a function node.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function example_ajax_enqueue() { | |
| // Enqueue javascript on the frontend. | |
| wp_enqueue_script( | |
| 'example-ajax-script', | |
| get_template_directory_uri() . '/js/simple-ajax-example.js', | |
| array( 'jquery' ) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var browser = cordova.InAppBrowser.open('http://amazon.com?vitumob_session_id=13279njke12hjhuidhiush124hu', '_blank', 'location=no'); | |
| browser.addEventListener('loadstart', function(event) { | |
| alert('Began loading this page: ' + JSON.stringify(event)); | |
| }); | |
| // event fires when the InAppBrowser finishes loading a URL. | |
| browser.addEventListener('loadstop', function(event) { | |
| // event => {type: 'loadstop', url: 'URL navigated to'} | |
| // alert('InAppBrowser Event: ' + JSON.stringify(event)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| primary: | |
| image: mongo:3.0 | |
| volumes: | |
| - ./p:/data | |
| ports: | |
| - "27017:27017" | |
| # Our current version of docker-compose doesn't allow extra_hosts which would be the best way | |
| # to add curcular dependency container links in this case. We cant upgrade docker-compose | |
| # without upgrading docker to 1.7, and we can't do that without upgrading the kernel on our | |
| # CentOS VM's. As such we are using the hostname hask below to allow primary and secondary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var AWS = require('aws-sdk'), | |
| fs = require('fs'); | |
| // http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html#Credentials_from_Disk | |
| AWS.config.loadFromPath('./aws-config.json'); | |
| // assume you already have the S3 Bucket created, and it is called ierg4210-shopxx-photos | |
| var photoBucket = new AWS.S3({params: {Bucket: 'ierg4210-shopxx-photos'}}); | |
| function uploadToS3(file, destFileName, callback) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // vanilla JS | |
| var event = document.createEvent("UIEvents"); | |
| event.initUIEvent("change", true, true); | |
| document.querySelector('input[type=file]').dispatchEvent(event); | |
| // jQuery | |
| $('input[type=file]').trigger('change'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| root /var/www/YOUR_DIRECTORY; | |
| index index.php index.html index.htm; | |
| ################################################### | |
| # Change "yoururl.com" to your host name | |
| server_name yoururl.com; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| - | |
| - The below code will convert a ng-repeat which display 3 column like | |
| - 1 | 2 | 3 | |
| - 4 | 5 | 6 | |
| - 7 | 8 | 9 | |
| - 10 | |
| - To | |
| - | |
| - 1 | 5 | 8 |
NewerOlder