Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Hasnain Bukhari BukhariH

🎯
Focusing
Block or report user

Report or block BukhariH

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@BukhariH
BukhariH / reduceArrayToObj.js
Last active Jul 12, 2017
Turn an Array of Objects into an Object using Reduce
View reduceArrayToObj.js
// change array & property to relevant values
const reducedObj = array.reduce(function(accum, item) {
accum[item.property] = item;
return accum;
}, {})
View gist:a6de426c6cd29db93ab582813442fb55
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
View gist:91990873c6b382ee09cb7849694a2d79
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@BukhariH
BukhariH / iterm2-solarized.md
Created Jun 5, 2016 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)
View gist:55a286ea28b36361e1db
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'
View Added Linux
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
View fetcher.rb
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
@BukhariH
BukhariH / 4.3.1 Photosynthesis Pigments.md
Last active Aug 29, 2015
4.3.1 Photosynthesis Pigment
View 4.3.1 Photosynthesis Pigments.md
  • 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
@BukhariH
BukhariH / gist:9125653
Last active Mar 11, 2019 — forked from zobar/gist:1499822
How to run a bot on Heroku
View gist:9125653
  1. Add Heroku to your Gemfile and bundle install.
  2. Create your Heroku app. This will only work with their (currently-beta) 'cedar' stack, so you have to heroku create --stack=cedar.
  3. 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
  4. Commit and push to Heroku.
  5. 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.
You can’t perform that action at this time.