You have Linux installed and running. The GUI is working fine, but you are getting tired of changing your desktop themes. You keep seeing this "terminal" thing.
- Presentazione
- introduzione a bash, ruby, irb
- Ruby basics (https://github.com/ict4g/ror-dw-2015/blob/gh-pages/guides/ruby-basics.md) no classes
- Simple function definition
- Everything is an expression
- Esercizi laboratorio/casa
"CanCan is an authorization library for Ruby on Rails which restricts what resources a given user is allowed to access. All permissions are defined in a single location (the Ability class) and not duplicated across controllers, views, and database queries."
Add this to your Gemfile and run the bundle install command
gem 'cancancan', '~> 1.10'
class Object | |
def my_method(sym) | |
MyMethod.new(self, sym) | |
end | |
end | |
class MyMethod | |
def initialize(obj, method) | |
@obj, @method = obj, method | |
end |
"A pundit is a person who offers to mass media their opinion or commentary on a particular subject area (typically political analysis, the social sciences, technology or sport) on which they are knowledgeable, or considered a scholar in said area" - Wikipedia
"Pundit provides a set of helpers which guide you in leveraging regular Ruby classes and object oriented design patterns to build a simple, robust and scaleable authorization system" - Github
In your Gemfile:
# http://codegolf.stackexchange.com/questions/64650/generate-toothpick-sequence | |
n = ARGV[0].to_i | |
$t = (n * 2).times.map { [' '] * n * 2} | |
def add_backslash_top (n,m,c) | |
if $t[n] && $t[n][m] == " " && c!=0 | |
$t[n][m] = '\\' | |
add_slash_left(n,m-1,c-1) |
damiano.stoffie@sci-b106pc035x:~$ lex --version | |
lex 2.5.35 |
array = ["america", "europe", "asia", "africa", "france", "usa", "spain", "paris", "los angeles"] | |
definitions = { | |
"continent" => ["america", "europe", "asia", "africa"], | |
"country" => ["france", "usa", "spain"], | |
"city" => ["paris", "los angeles"], | |
"planet" => ["mars","earth"] | |
} | |
inverse_array = definitions.map {|k,v| v.map { |e| [e, k]}}.flatten(1) |