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
| def create_directly | |
| @attachment = Attachment.new | |
| file_name = params[:file_name] | |
| if request.body.class == StringIO | |
| FileUtils.mkdir "#{Rails.root}/tmp/" + @attachment.id.to_s | |
| file = File.open("#{Rails.root}/tmp/" + @attachment.id.to_s + "/" + file_name, "w") | |
| file << request.body.string | |
| file.close | |
| @attachment.attachment = File.open("#{Rails.root}/tmp/" + @attachment.id.to_s + "/" + file_name, "r") |
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
| class rfidDevice | |
| { | |
| eventHandler = null; | |
| serPort = null; | |
| enabled = true; | |
| rxData = ""; | |
| name = "Source"; | |
| type = "string"; |
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
| def crossover_sku(sku) | |
| sku1 = sku.code.split("-")[0..3].join("-") | |
| sku2 = sku.code.split("-")[4..7].join("-") | |
| [sku1, sku2] | |
| end | |
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
| curl -X POST -H "Content-Type: application/json" -d '{ | |
| "clock": { | |
| "offset": -14400 | |
| }, | |
| "gauges": [ | |
| { | |
| "label": "EMAIL", | |
| "position": 75.8948 | |
| }, | |
| { |
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
| transfer_proc = Elvis::Processes::Outbound::OhlTransfer.new(CONFIG, CONFIG["netsuite"]["ohl_transfers"], {:warehouse_code => "OCP"}) | |
| transfer = NetSuite::Records::TransferOrder.get(:internal_id => 1234) | |
| transfer_proc.send_sales_order(transfer) |
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
| // =FACTORY=AGENT============================================================== // | |
| const projectName = "Pivot Power Genius" | |
| // Factory IMP Device Code | |
| // ---------------------------------------------------------------------------- // | |
| const MAJOR_VER = 0; // Major Version of this Release | |
| const MINOR_VER = 1; // Minor Version of this Release | |
| const RELEASE = 0; // Release Number of this Version | |
| // ---------------------------------------------------------------------------- // | |
| // Revision History | |
| // V0.1.0 - <_G> Initial Release |
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
| mac <- imp.getmacaddress() | |
| impeeid <- hardware.getimpeeid() | |
| agent.send("register", { mac = mac, impeeid = impeeid }) |
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
| 2013-10-22 17:38:43 UTC-4: [Status] Device booting | |
| 2013-10-22 17:38:43 UTC-4: [Device] Bank 1 set to 0. | |
| 2013-10-22 17:38:43 UTC-4: [Device] Bank 1 is online. | |
| 2013-10-22 17:38:43 UTC-4: [Device] Bank 2 set to 0. | |
| 2013-10-22 17:38:43 UTC-4: [Device] Bank 2 is online. | |
| 2013-10-22 17:38:43 UTC-4: [Device] Pivot Power Genius | |
| 2013-10-22 17:38:43 UTC-4: [Device] Firmware Version: v0.2.2 | |
| 2013-10-22 17:38:44 UTC-4: [Device] Device ID: 20000c2a69028be9 | |
| 2013-10-22 17:38:44 UTC-4: [Status] Device configured to be "Pivot Power Genius" | |
| 2013-10-22 17:38:44 UTC-4: [Device] Node Registered |
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
| 2013-10-22 17:40:24 UTC-4: [Status] Device booting | |
| 2013-10-22 17:40:24 UTC-4: [Agent] Pivot Power Genius Agent Running | |
| 2013-10-22 17:40:24 UTC-4: [Agent] Agent Version: v0.3.2 | |
| 2013-10-22 17:40:24 UTC-4: [Agent] State::restoreState checking state package for possible state to restore | |
| 2013-10-22 17:40:24 UTC-4: [Agent] winkDeviceId = 430 | |
| 2013-10-22 17:40:24 UTC-4: [Agent] hmacSha1Psk = 59b080e4e2ab2d0535e453f96cef8e4cf3119e68 | |
| 2013-10-22 17:40:24 UTC-4: [Agent] stateEndpoint = https://winkapi.quirky.com/powerstrips/430 | |
| 2013-10-22 17:40:24 UTC-4: [Agent] tokenEndpoint = https://winkapi.quirky.com/oauth2/token | |
| 2013-10-22 17:40:24 UTC-4: [Agent] accessToken = 06264e2806719ed9306a1e0d56217f70 | |
| 2013-10-22 17:40:24 UTC-4: [Agent] refreshToken = f55ce8762538131bc3d86b5211353ace |
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
| #!/usr/bin/env node | |
| var fs = require('fs'), | |
| stream = require('stream'), | |
| path = require('path'), | |
| cadence = require('cadence'), | |
| run = require('./monitor/run') | |
| require('cadence')(module, cadence(function (step, options) { | |
| var pems = {}, config = {}, params = {}, useSSL |
OlderNewer