This file contains hidden or 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
| dilraj@TurboGrafix16:~$ pry | |
| [1] pry(main)> Math.sqrt(69) | |
| => 8.306623862918075 | |
| [2] pry(main)> Time.now | |
| => 2016-04-27 04:15:58 -0400 | |
| [3] pry(main)> Array.new(10) | |
| => [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil] | |
| [4] pry(main)> Array.new(10,"yeezy") | |
| => ["yeezy", | |
| "yeezy", |
This file contains hidden or 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
| class Robot | |
| attr_accessor :x, :y, :position | |
| def initialize | |
| @x = 0 | |
| @y = 0 | |
| @position = [] | |
| end |
This file contains hidden or 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
| function arrayOfLight(x) { | |
| var ultraLightBeam = []; | |
| for (var i = 0; i <= x; i++) { | |
| ultraLightBeam.push(i); | |
| } | |
| console.log(ultraLightBeam); | |
| } | |
| var amount = prompt("Enter the Ultraight Beamness level!"); | |
| arrayOfLight(amount); |
This file contains hidden or 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 benchmark | |
| # Initialize the times | |
| start_time = Time.now | |
| yield | |
| end_time = Time.now | |
| running_time = end_time - start_time | |
| puts "string.reverse took #{running_time} seconds to run" | |
| end | |
| benchmark { |
This file contains hidden or 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
| # An important extention for Ruby... we need it for the date to manipulate data | |
| require 'active_support/all' | |
| @candidates = | |
| [ | |
| { | |
| id: 5, | |
| years_of_experience: 4, | |
| github_points: 293, | |
| languages: ['C', 'Ruby', 'Python', 'Clojure'], |
This file contains hidden or 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 maximum(arr) | |
| highest = arr[0] | |
| arr.each {|num| return highest = num if num>highest} | |
| return highest | |
| end | |
| puts maximum([19, 69, 21, 55]) |
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 1 column, instead of 2 in line 2.
This file contains hidden or 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
| Medtronic Diabetes CareLink Personal Data Export File (v1.0.1) | |
| PATIENT INFO | |
| Name,Dilraj Somel | |
| Report Range,17/03/16,to,08/06/16 | |
| DEVICE INFO | |
| Meter:,Linked Meter,#CE44BF,, | |
| Pump:,Paradigm 722,#596907,VER 2.4A1.1, | |
| Data Exported on,08/06/16 12:02 AM | |
| DEVICE DATA (1715 records) | |
| Data Range,17/03/16 00:00:00,to,07/06/16 23:53:35 |
This file contains hidden or 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 dilraj = { | |
| date: '', | |
| time:[], | |
| bg:[], | |
| bolus:[], | |
| carbs:[], | |
| total:[] | |
| }; |
This file contains hidden or 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
| $(document).ready(function(){ | |
| /* Listening for keypress events on the firstname input box */ | |
| $("#fname").keypress(function(event){ | |
| switch(event.which){ | |
| case 65: | |
| console.log("[SHIFT] + [A]") | |
| break; | |
| case 16: | |
| console.log("[SHIFT]") | |
| break; |
This file contains hidden or 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
| // 'use strict'; | |
| // console.log('You got $' + cash); | |
| // var amount = function bet(){ | |
| // amount = prompt("Place a bet between $5-$10: "); | |
| // while (amount < 5 || amount > 10){ | |
| // alert("That's not right!"); | |
| // amount = prompt("Bet must be between $5-$10. Try Again: "); | |
| // } |
OlderNewer