This file contains 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
vim.cmd([[set runtimepath=$VIMRUNTIME]]) | |
vim.cmd([[set packpath=/tmp/nvim/lazy]]) | |
local package_root = '/tmp/nvim/lazy' | |
local plugin_folder = function() | |
local host = os.getenv('HOST_NAME') | |
if host and (host:find('Ray') or host:find('ray')) then | |
return [[~/github/ray-x]] -- vim.fn.expand("$HOME") .. '/github/' | |
else | |
return '' |
This file contains 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
# bin/FoneFinderTest.rb | |
#!/usr/bin/env ruby | |
require 'FoneFinder' | |
puts "Please enter a phone number!" | |
object = FoneFinder.new(STDIN.gets.chomp) | |
unless object.invalid | |
puts "City: #{object.city}" |
This file contains 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
#!/bin/sh | |
# # Kontena "Bring your own node" install script | |
# | |
# This script will configure and run Kontena Agent on a variety of systems, including MacOS and most Linux distributions and join it to a grid | |
# | |
# ## Requirements | |
# | |
# * A working Docker installation (`docker run` should work from the command line) |
This file contains 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
/* Automatically generated nanopb constant definitions */ | |
/* Generated by nanopb-0.3.6 at Thu Nov 9 22:08:54 2017. */ | |
#include "sensor.pb.h" | |
/* @@protoc_insertion_point(includes) */ | |
#if PB_PROTO_HEADER_VERSION != 30 | |
#error Regenerate this file with the current version of nanopb generator. | |
#endif |
This file contains 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
/* Automatically generated nanopb header */ | |
/* Generated by nanopb-0.3.6 at Thu Nov 9 22:08:54 2017. */ | |
#ifndef PB_SENSOR_PB_H_INCLUDED | |
#define PB_SENSOR_PB_H_INCLUDED | |
#include <pb.h> | |
/* @@protoc_insertion_point(includes) */ | |
#if PB_PROTO_HEADER_VERSION != 30 | |
#error Regenerate this file with the current version of nanopb generator. |
This file contains 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
syntax = "proto3"; | |
message SensorReport { | |
uint32 device_id = 1; | |
uint32 sensor_id = 2; | |
uint32 timestamp = 3; | |
oneof value { | |
float f = 4; | |
uint32 percentage = 5; | |
int32 val = 6; |
This file contains 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
SensorReport message = SensorReport_init_zero; | |
pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); | |
message.device_id = 1; | |
message.sensor_id = (uint32_t)2; | |
message.which_value = SensorReport_f_tag; | |
message.value.f = currTemp; | |
status = pb_encode(&stream, SensorReport_fields, &message); | |
message_length = stream.bytes_written; | |
if (!status) { |
This file contains 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
add_message "SensorReport" do | |
optional :device_id, :uint32, 1 | |
optional :sensor_id, :uint32, 2 | |
optional :timestamp, :uint32, 3 | |
oneof :value do | |
optional :f, :float, 4 | |
optional :percentage, :uint32, 5 | |
optional :val, :int32, 6 | |
optional :b, :bool, 7 | |
end |
This file contains 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
module Recipe | |
Version = Class.new(Gem::Version) | |
class Definition | |
attr_reader :options | |
def initialize(recipe_name, options = {}) | |
@options = options | |
recipe recipe_name | |
end |
This file contains 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
stream = Class.new(Queue) { alias_method :write, :push }.new | |
orig_stdout = $stdout | |
$stdout = stream | |
Thread.new do | |
loop do | |
puts Time.now | |
sleep 0.5 | |
end | |
end |
NewerOlder