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
// Turn const ARRAY = [{type: "FOO", content: "Test 0"}, {type: "BAR", content: "Test 1"}, {type: "FOO", content: "Test 2"}] | |
// Into ["FOO", "BAR"] | |
// Using getUniqueProperties(ARRAY, 'type') | |
getUniqueProperties = (array, property)=>{ | |
return [...new Set(array.map(elem => elem[property]))] | |
} |
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
// change array & property to relevant values | |
const reducedObj = array.reduce(function(accum, item) { | |
accum[item.property] = item; | |
return accum; | |
}, {}) |
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
package main | |
import ( | |
"net/http" | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
) |
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
package main | |
import ( | |
"net/http" | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
) |
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
alias desktop='cd /Users/Hasnain/Desktop' | |
alias fs='foreman start' | |
alias fsdev='foreman start -f Procfile-dev' | |
alias bu='bundle update' | |
alias rs='rails s' | |
alias be='bundle exec' | |
alias gems='cd /Users/Hasnain/dev/gem' | |
alias web='cd /Users/Hasnain/dev/web' | |
alias tmp='cd /Users/Hasnain/dev/tmp' | |
alias nit='cd /Users/Hasnain/Nitrous' |
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
require 'json' | |
require 'net/http' | |
require 'uri' | |
require 'rbconfig' | |
require 'io/console' | |
puts "Enter Username:" | |
@username = gets.chomp | |
puts "Enter Password (input will be hidden):" | |
@password = STDIN.noecho(&:gets).chomp |
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
require 'json' | |
require 'net/http' | |
require 'uri' | |
require 'rbconfig' | |
require 'io/console' | |
puts "Enter Username:" | |
@username = gets.chomp | |
puts "Enter Password (input will be hidden):" | |
@password = STDIN.noecho(&:gets).chomp |
-
f) define the term photosynthetic pigment;
- Photosynthetic pigments are molecules that absorb light energy.
- Each pigment absorbs a specific wavelength of light in the visible light region
- Each pigment also has specific peak of absorption
- Wavelengths outside the range a reflected
- This reflected light is the colour which they appear to us as
-
g) explain the importance of photosynthetic pigments in photosynthesis;
- Photosynthetic Pigments are held in place by proteins in the thylakoid membranes
- They are arranged in a funnel shape structure called a photosystem
- Add Heroku to your Gemfile and
bundle install
. - Create your Heroku app. This will only work with their (currently-beta)
'cedar' stack, so you have to
heroku create --stack=cedar
. - Create a Procfile for your bot. This tells Heroku how to run your worker. In
our case, the bot is bot.rb, so the only line in the Procfile is
cinch: bundle exec ./bot.rb
- Commit and push to Heroku.
- You do not want a Web worker running, so
heroku scale web=0 cinch=1
. This also sets up your deployments to restart the bot.
NewerOlder