This file contains 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
def hello | |
"Hello world" | |
end | |
def add(a,b) | |
a + b | |
end | |
add(1,2) | |
p add(1,2) |
This file contains 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
# url = web address | |
# text = the link | |
def link(url, text) | |
"<a href=#{url}>#{text}</a>" | |
end | |
p link("http://dontpuzzle.me", "my web site") | |
# the Output is: | |
# "<a href=http://dontpuzzle.me>my web site</a>" |
This file contains 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
def get_squares(n) | |
n.to_a | |
squares = [] | |
n.each do |i| | |
if (i ** 0.5).to_s[-2..-1] == ".0" | |
if squares.include? i | |
squares | |
else | |
squares.push(i) | |
end |
This file contains 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
<h1>New Post</h1> | |
<div class="row"> | |
- <div class="col-md-6"> | |
+ <div class="col-md-4"> | |
<p>Guidelines for posts</p> | |
<ul> | |
<li>Make sure the it rhymes.</li> |
This file contains 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
// x positions of baloons and ropes | |
var xPositions = [100, 200]; | |
//when i want more than 1 baloon i need to create | |
//a variable that grows | |
var newInd = 2; | |
var draw = function(){ | |
if (mouseIsPressed){ | |
xPosition[newInd] = mouseX; | |
newInd++; |
This file contains 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
var model = { | |
currentCat: null, | |
cats: [ | |
{ | |
catName: "joe", | |
catCount: 0, | |
imgSource: "img/cat0.jpg" | |
}, | |
{ |
This file contains 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
f |
This file contains 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
' CICLO TACCHE --------------------------------------------------------------------------------------------------------- | |
strNotches = "" | |
Dim dvNotches As New DataView(gdtSegment) | |
dvNotches.RowFilter = "IdPattern = " & shtCSVPattern & " AND SegType = 10" | |
dvNotches.Sort = "SegSeq" |
This file contains 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
<RecordType id="002"> | |
<NameSize>A</NameSize> <!--Taglie componenti codice--> | |
<CodeSize>48@M1#1,50@M1#1</CodeSize> <!--Taglie componenti--> | |
<MarkerName>A.gbr</MarkerName> <!--Nome del marker--> | |
<Length>101</Length> <!--Lunghezza del marker in cm--> | |
<OverlapsMarker>34,45</OverlapsMarker> <!--splice in cm--> | |
</RecordType> |
This file contains 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
// my solution | |
// I copied the name of the first parameter from Ben Baik solution because | |
// it's a great choice. Maybe it's redundant because 'runWithDebugger' is | |
// already meaningful. I take no risk: redundant maybe, but superclear! :-) | |
function runWithDebugger(functionToDebug, functionToDebugArgs) { | |
debugger; | |
functionToDebug.apply(null, functionToDebugArgs); | |
} |
OlderNewer