Skip to content

Instantly share code, notes, and snippets.

View kajatiger's full-sized avatar
👩‍💻
hacking the patriarchy

kaja kajatiger

👩‍💻
hacking the patriarchy
View GitHub Profile

Keybase proof

I hereby claim:

  • I am kajatiger on github.
  • I am kaja (https://keybase.io/kaja) on keybase.
  • I have a public key ASAO66UqrqbLKnDk80464wvNiZKKoA9xhrdv9goUn8G-ego

To claim this, I am signing this object:

Keybase proof I hereby claim: * I am kajatiger on github. * I am kaja (https://keybase.io/kaja) on keybase. * I have a public key ASAO66UqrqbLKnDk80464wvNiZKKoA9xhrdv9goUn8G-ego To claim this, I am signing this object: ```json { "body": { "key": { "eldest_kid": "01200eeba52aaea6cb2a70e4f34e3ae30bcd89928aa00f7186b76ff60a149fc1be7a0a", "host": "keybase.io", "kid": "01200eeba52aaea6cb2a70e4f34e3ae30bcd89928aa00f7186b76ff60a149fc1be7a0a", "uid": "99763235b36a8ca5275181f7428b8819", "username": "kaja" }, "merkle_root": { "ctime": 1511449892, "hash": "5fc621ff34dd2ee699a7719b34bbec8c6e4db81b085173400d4529e76f581a0d79e0ff127f35fde102b12fa076894bc8ef1fe16f105bf543550521c39125b5c6", "hash_meta": "b49767d6aa00d09830c2a0457adb72ad58d487d5f6beaa4069a1558954f33183", "seqno": 1739245 }, "service": { "name": "github", "username": "kajatiger" }, "type": "web_service_binding", "version": 1 }, "client": { "n

@kajatiger
kajatiger / products_controller.rb
Created November 11, 2016 15:52
not sure if this is enough to separate development search terms from production search terms
class ProductsController < ApplicationController
before_action :set_product, only: [:show, :edit, :update, :destroy]
# GET /products
# GET /products.json
if RAILS_ENV == "development"
def index
if params[:q]
search_term = params[:q]
@products = Product.where("name LIKE ?", "%#{search_term}%")
@kajatiger
kajatiger / ruby_game.rb
Created October 31, 2016 16:16
play rock, scissors, paper against my code
puts "please type rock, scissors or paper"
player = gets.chomp
rand(1..3)
if rand(1..3) == 1
computer = "rock"
elsif rand(1..3) == 2
@kajatiger
kajatiger / pet.rb
Created October 20, 2016 13:03
inheritance class
class Pet
attr_reader :color, :breed
attr_accessor :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
end
@kajatiger
kajatiger / cat.rb
Created October 20, 2016 12:01
creating a class
class Cat
attr_reader :color, :breed #:name
attr_accessor :name #instead of mentioning the attribute both in reader and writer, we can do both in the same time with accessor
#attr_writer :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
end
@kajatiger
kajatiger / fav_foods.rb
Created October 19, 2016 20:28
iterating through favorite foods
def fav_foods
food_ary = Array.new
3.times do
puts "name a favorite food"
food_ary << gets.chomp
food_ary.each do |food|
puts "I like #{food} too!"
end
end
puts "your favorite foods are #{food_ary.join(", ")}."
@kajatiger
kajatiger / program2.rb
Created October 19, 2016 20:02
conditional ruby blocks
if (5+5==10)
puts "this is true"
else
puts "this is false"
end
@kajatiger
kajatiger / program.rb
Created October 19, 2016 19:26
simple ruby def
def greeting
puts "please enter your name"
name = gets.chomp
puts "hello" + " " + name
end
greeting
@kajatiger
kajatiger / index.html down
Created October 14, 2016 18:26
implementing google maps
<script src="js/scripts.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyACgYearY6AZ7p6x5SM2gr6PB2cNkTAOZ4&callback=initMap"
async defer></script>