I hereby claim:
- I am mattnwa on github.
- I am mluker001 (https://keybase.io/mluker001) on keybase.
- I have a public key ASC-o49bG946FhZ7W7Wl6Hg1MBT6LY326NoKrmFj3d3xkwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| # 1) Create your private key (any password will do, we remove it below) | |
| $ cd ~/.ssh | |
| $ openssl genrsa -des3 -out server.orig.key 2048 | |
| # 2) Remove the password | |
| $ openssl rsa -in server.orig.key -out server.key |
| # require 'benchmark/ips' | |
| Benchmark.ips do |x| | |
| # the warmup phase (default 2) and calculation phase (default 5) | |
| x.config(:time => 5, :warmup => 2) | |
| Times = 500 | |
| times = Times | |
| def upsert(id) | |
| Score.upsert({scoreable_id: 7864, scoreable_type: 'FacebookPage'}, raw_value: 1234) | |
| end |
| // Bonfire: Where do I belong | |
| // Author: @mattnwa | |
| // Challenge: http://www.freecodecamp.com/challenges/bonfire-where-do-i-belong# | |
| // Learn to Code at Free Code Camp (www.freecodecamp.com) | |
| function where(arr, num) { | |
| // Find my place in this sorted array. | |
| arr.push(num); | |
| arr.sort(function(a,b){ | |
| return a-b; |
| // Bonfire: Falsy Bouncer | |
| // Author: @mattnwa | |
| // Challenge: http://www.freecodecamp.com/challenges/bonfire-falsy-bouncer | |
| // Learn to Code at Free Code Camp (www.freecodecamp.com) | |
| function bouncer(arr) { | |
| // Don't show a false ID to this bouncer. | |
| return arr.filter(Boolean); | |
| } |
| // Bonfire: Mutations | |
| // Author: @mattnwa | |
| // Challenge: http://www.freecodecamp.com/challenges/bonfire-mutations | |
| // Learn to Code at Free Code Camp (www.freecodecamp.com) | |
| function mutation(arr) { | |
| var elem0 = arr[0].toLowerCase(); | |
| var elem1 = arr[1].toLowerCase(); | |
| for(var i = 0; i < elem1.length; i++){ |
| // Bonfire: Slasher Flick | |
| // Author: @mattnwa | |
| // Challenge: http://www.freecodecamp.com/challenges/bonfire-slasher-flick | |
| // Learn to Code at Free Code Camp (www.freecodecamp.com) | |
| function slasher(arr, howMany) { | |
| // it doesn't always pay to be first | |
| if (howMany < 1) { | |
| return arr; | |
| } else { |
| // Bonfire: Chunky Monkey | |
| // Author: @mattnwa | |
| // Challenge: http://www.freecodecamp.com/challenges/bonfire-chunky-monkey | |
| // Learn to Code at Free Code Camp (www.freecodecamp.com) | |
| function chunk(arr, size) { | |
| var temp = []; | |
| for(var i = 0; i < arr.length; i){ | |
| temp.push(arr.slice(i, i+=size)); |
| // Bonfire: Truncate a string | |
| // Author: @mattnwa | |
| // Challenge: http://www.freecodecamp.com/challenges/bonfire-truncate-a-string | |
| // Learn to Code at Free Code Camp (www.freecodecamp.com) | |
| function truncate(str, num) { | |
| // Clear out that junk in your trunk | |
| if (num <=3) { | |
| return str.slice(0, num) + "..."; |
| // Bonfire: Title Case a Sentence | |
| // Author: @mattnwa | |
| // Challenge: http://www.freecodecamp.com/challenges/bonfire-title-case-a-sentence | |
| // Learn to Code at Free Code Camp (www.freecodecamp.com) | |
| function titleCase(str) { | |
| strLowercase = str.toLowerCase().split(' '); | |
| for (var i =0; i <strLowercase.length; i++){ | |
| strLowercase[i] = strLowercase[i].split(''); | |
| strLowercase[i][0] = strLowercase[i][0].toUpperCase(); |