Skip to content

Instantly share code, notes, and snippets.

View pyk's full-sized avatar
🐈‍⬛
I may be slow to respond.

pyk pyk

🐈‍⬛
I may be slow to respond.
View GitHub Profile

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>

Ruby on Rails development setup on Ubuntu 12.04

System update

# change mirror to ubuntu.osuosl.org first
sudo apt-get update

Install common libraries

sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev

/**
* Generates JavaScript version of HTML templates for AngularJS as part of a Grunt build
*
* Allows for bundling into multiple collections, for applications that are distributed across more than one page.
*
* Usage (in grunt.initConfig):
*
* html2js: {
* firstTemplateCollection: {
* src: ['<%= src.first %>'],
@pyk
pyk / example.rb
Created December 18, 2013 07:28 — forked from britishtea/example.rb
require 'function'
# A fibonacci function.
fib = Function.new
fib[0] = 0
fib[1] = 1
fib[Integer] = proc { |i| fib[i - 2] + fib[i - 1] }
p fib[0] # => 0
@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
# 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 / 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
@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: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

punya satu kategori:

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

terus ada beberapa produk yang dimasukkan ke kategori shoes:

sepatu_a = Product.create(name: "sepatu a")