Ruby 2.1.0
user system total real
StandardSingleton: 0.141000 0.000000 0.141000 ( 0.129891)
MethodMissingSingleton: 0.125000 0.000000 0.125000 ( 0.130870)
{ | |
# First, we need to add an empty key/value tuple (just an empty fork) to this `execution`, in preperation for | |
# making a `locals` list to store variables on. | |
# | |
# ┌ - we have to assume that native juxtaposition of `infrastructure` against the root-level `execution` will | |
# │ somehow “fall through.” I haven’t yet figured out the semantics of Nuclear-level scoping/fall-through. | |
# │ - considering: if `<this> locals` nothingnesses-out, then we juxtapose against enclosing scope at the | |
# │ interpreter level (which would imply, at this root scope, juxtaposing against the global scope I suppose) | |
# │ | |
# │ ┌ - no `call()` implemented at this level, so we have to assume that the native-default juxtaposition for |
# CLOSURES IN RUBY Paul Cantrell http://innig.net | |
# Email: username "cantrell", domain name "pobox.com" | |
# I recommend executing this file, then reading it alongside its output. | |
# | |
# Alteratively, you can give yourself a sort of Ruby test by deleting all the comments, | |
# then trying to guess the output of the code! | |
# A closure is a block of code which meets three criteria: | |
# |
module Sq | |
class Template < Sequel::Model | |
one_to_many :fields | |
def mapped_template_ids | |
FieldMapping.as(:m). | |
join(Field.named(:f), id: :field_id, template_id: id). | |
join(Field.named(:mf), id: :m__mapped_field_id). | |
distinct.select_map(:mf__template_id) | |
end |
Simple way to run stuff like sudo shutdown
without entering a password.
Tip: do not use this in production, I use it to shutdown my VMs when I'm done working
sudo EDITOR=vim visudo
noners
: %noners ALL=(ALL) ALL
sudo vim /etc/sudoers.d/g_noners
marian
then just add:data_sample = [ | |
name: "Mrianescu" | |
coords: [0, 0] | |
, | |
name: "Marianescu" | |
coords: [0, 0] | |
, | |
name: "Marian" | |
coords: [0, 0] | |
, |
module KawaiiPhrase | |
# Makes awesome random phrases such as "Enjoyable Green Turtle" | |
ADJ_1 = [ | |
'epic', | |
'tasty', | |
'shiny', | |
'mega', | |
'ultra', | |
'hyper', |