Skip to content

Instantly share code, notes, and snippets.

View ydawant's full-sized avatar

Yannick Dawant ydawant

View GitHub Profile
@ydawant
ydawant / gist:7475537
Created November 14, 2013 22:36
chef error.
/Users/yannickdawant/.rvm/gems/ruby-1.9.3-p448/gems/knife-solo-0.4.0/lib/knife-solo/node_config_command.rb:44:in `exist?': can't convert Array into String (TypeError)
from /Users/yannickdawant/.rvm/gems/ruby-1.9.3-p448/gems/knife-solo-0.4.0/lib/knife-solo/node_config_command.rb:44:in `nodes_path'
from /Users/yannickdawant/.rvm/gems/ruby-1.9.3-p448/gems/knife-solo-0.4.0/lib/knife-solo/node_config_command.rb:48:in `node_config'
from /Users/yannickdawant/.rvm/gems/ruby-1.9.3-p448/gems/knife-solo-0.4.0/lib/knife-solo/node_config_command.rb:57:in `node_environment'
from /Users/yannickdawant/.rvm/gems/ruby-1.9.3-p448/gems/knife-solo-0.4.0/lib/chef/knife/solo_cook.rb:264:in `check_chef_version'
from /Users/yannickdawant/.rvm/gems/ruby-1.9.3-p448/gems/knife-solo-0.4.0/lib/chef/knife/solo_cook.rb:82:in `block in run'
from /Users/yannickdawant/.rvm/gems/ruby-1.9.3-p448/gems/knife-solo-0.4.0/lib/chef/knife/solo_cook.rb:198:in `time'
from /Users/yannickdawant/.rvm/gems/ruby-1.9.3-p448/gems/knife-solo-0.4.0/lib/che
@ydawant
ydawant / zoo.js
Last active December 17, 2015 16:09 — forked from dbc-challenges/zoo.js
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
function Animal(name, legs) {
this.legs = legs;
this.name = name;
};
Animal.prototype.identify = function() {
return "I am a " + this.name + " with " + this.legs + " legs.";
};
@ydawant
ydawant / index.html
Last active December 17, 2015 15:59 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>
/* Here is your chance to take over Socrates!
Spend 10 minutes on each of the following hacks to the socrates website.
Enter them in the console to make sure it works and then save
your results here.
Choose a new pair for each. Add your names to the section you complete.
*/
@ydawant
ydawant / gist:5199296
Last active December 15, 2015 04:09
Array Pad
class Array
def pad!(min_size, value = nil)
array = Array.new(min_size, value)
if self.length < min_size
i = 0
until i == self.length
array[i] = self[i]
i += 1
end
@ydawant
ydawant / gist:5193341
Created March 19, 2013 02:45
Times Table - no spaces
def times_table(rows)
array = Array.new(rows) { Array.new(rows) }
y=0
array.each_with_index do |x, index|
until y == rows
x[y] = index+1
x[y] *= (y + 1)
y += 1
@ydawant
ydawant / gist:5190612
Created March 18, 2013 20:40
Times Table
def times_table(rows)
array = Array.new(rows) { Array.new(rows) }
y=0
array.each do |x|
x.each do |i|
until y == rows
x[y] = 1