Skip to content

Instantly share code, notes, and snippets.

View pyk's full-sized avatar
🌐

pyk pyk

🌐
View GitHub Profile
  1. General Background and Overview
@pyk
pyk / markdown.css
Last active August 29, 2015 14:19 — forked from imjasonh/markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
package your_package;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
@pyk
pyk / pyramid.out
Created February 23, 2014 22:32 — forked from tamouse/pyramid.out
[6] pry(main)> load 'pyramid.rb'
=> true
[7] pry(main)> pyr1 = Pyramid.new(5)
=> #<Pyramid:0x007fb08e74a9a0
@pyramid=[[1], [2, 1], [3, 2, 1], [4, 3, 2, 1], [5, 4, 3, 2, 1]],
@size=5>
[8] pry(main)> print pyr1
1
2 1
3 2 1

punya satu kategori:

shoes = Category.create(name: "shoes")

terus ada beberapa produk yang dimasukkan ke kategori shoes:

sepatu_a = Product.create(name: "sepatu a")
@pyk
pyk / gist:8815299
Last active August 29, 2015 13:56 — forked from schneems/gist:3079202
## Week 5 Quiz
## 0) Name 3 types of variables in Ruby? Put them in order from least scope to greatest.
local variable (var) , instance variable (@var), class variable (@@var), constant variable (VAR)
## 1) Where do SQL queries belong, the view or controller?
controller
@pyk
pyk / gist:8718360
Last active August 29, 2015 13:55 — forked from schneems/gist:3029994
## 1) What does MVCr stand for?
Model, View, Controller (routes)
## 2) In what file do we store 'r' from MVCr ?
config/routes.rb
@pyk
pyk / gist:8613205
Last active January 4, 2016 11:09 — forked from schneems/gist:3036609
## Week 3 Quiz
## 1) What does ERB stand for?
Embedded Ruby
## 2) What is the name of the place (library) where additional built in Ruby functions can be accessed?
STDlib
# generate using this gems : http://rubygems.org/gems/terminal-table
require "terminal-table"
title = "posts"
properties = ["id", "title", "author_name", "body"]
r = []
r << [1, "I love dogs", "John", "woof"]
r << [2, "cars are great", "Sara", "I think they are"]
@pyk
pyk / less_converter.rb
Last active January 2, 2016 18:49 — forked from KBalderson/less_converter.rb
Using LESS on Jekyll site . for using intructions see here https://kippt.com/bayu/notes/clips/18862841
module Jekyll
class LessConverter < Converter
safe true
priority :high
def setup
return if @setup
require 'less'
@setup = true
rescue LoadError