Skip to content

Instantly share code, notes, and snippets.

View jreidinger's full-sized avatar

Josef Reidinger jreidinger

View GitHub Profile
@jreidinger
jreidinger / print_deps.rb
Last active September 19, 2016 13:46
build service dependency chain
require "yaml"
require "cheetah"
require "pp"
require "rexml/document"
class Package
attr_accessor :layer, :name, :depends, :time, :total_time
def initialize(name, depends)
@name = name
disks = a_devicegraph.disks # A disks object, Array on steroids
disks = disks.with(name: ["/dev/sda", "/dev/sdb"]) # another disks object
primary_parts = disks.partitions.with(type: :primary) # A Partitions object, another Array on steroids
parts = disks.partitions.with(name: ["/dev/sda2", "/dev/sdc3"])
# equivalent line
# parts = a_devicegraph.disks.partitions.with(name: ["/dev/sda2", "/dev/sdc3"])
# Calls to whatever.filesystems returns a Filesystems object which is another Array on steroids
# So the equivalent to previous example (https://gist.github.com/ancorgs/9c628ef0f4fa717a2817) would be
a_device_graph.filesystems.to_a # all file systems in the devicegraph
@jreidinger
jreidinger / grab script
Created October 5, 2011 12:50
enlightment nightly build grab script
#!/bin/bash
set -e
PROJECTS=(
eina
eet
evas
ecore
embryo
edje
e_dbus
@jreidinger
jreidinger / allowed_type_benchmark.rb
Last active June 29, 2016 07:47
yast installation profile
require "yast"
require "benchmark"
VALUES = ["any", "nil", "void", "boolean", "string", "symbol", "integer",
"float", "list", "map", "term", "path", "locale", "function",
"byteblock"
]
def replacement(object, to)
types = Yast::Ops::TYPES_MAP[to]