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
#!/bin/sh /etc/rc.common | |
START=91 | |
USE_PROCD=1 | |
PROG=/root/overture/overture-linux-arm | |
CONFIG=/root/overture/config.json | |
start_service() { | |
procd_open_instance | |
procd_set_param respawn |
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
# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API. | |
# | |
# This is used for generating API documentation and the types used by the | |
# client/server. See api/README.md for more information. | |
# | |
# Some style notes: | |
# - This file is used by ReDoc, which allows GitHub Flavored Markdown in | |
# descriptions. | |
# - There is no maximum line length, for ease of editing and pretty diffs. | |
# - operationIds are in the format "NounVerb", with a singular noun. |
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 python | |
import sys | |
import subprocess, shlex | |
import os | |
import readline # for history support | |
os.environ['PROMPT'] = '> ' | |
def builtin_export(arg): | |
key, value = arg.split('=') |
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
# 0. init the todo | |
# items = %w{ tomato potato eggs socks } | |
items = { | |
'tomato' => false, | |
'potato' => true, | |
'eggs' => false | |
} | |
def prompt(msg) | |
puts msg |
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 WagonString | |
def initialize(string) | |
# TODO: store the string as array of characters | |
end | |
def to_s | |
# TODO: convert into a Ruby String | |
end | |
def reverse |
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 BaseModel | |
attr_accessor :id | |
def initialize(attributes = {}) | |
@id = attributes[:id] | |
end | |
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
class Patient | |
attr_accessor :id, :room | |
attr_reader :name | |
def initialize(attributes = {}) | |
@id = attributes[:id] | |
@name = attributes[:name] | |
@cured = attributes[:cured] || false | |
attributes[:room].add_patient(self) |
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
require "nokogiri" | |
require "open-uri" | |
doc = Nokogiri::HTML(open("http://www.letscookfrench.com/recipes/find-recipe.aspx?s=strawberry&type=all")) | |
# puts doc.class | |
# CSS selector => | |
# a => elements named a | |
# #logo => element with attr id=logo |
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
require_relative 'tasks_view' | |
class AudibleTasksView < TasksView | |
def puts(args) | |
super | |
`say '#{args}'` | |
end | |
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
require_relative 'router' | |
require_relative 'tasks_controller' | |
require_relative 'tasks_repository' | |
repo = TasksRepository.new | |
controller = TasksController.new(repo) | |
Router.new(controller).run |
NewerOlder