Skip to content

Instantly share code, notes, and snippets.

View tonkec's full-sized avatar
🚀
focusing

Antonija Šimić tonkec

🚀
focusing
View GitHub Profile
@tonkec
tonkec / posts_controller.rb
Last active March 31, 2016 12:31
allowed tags
def create
@existing_tag_list_array = ["ruby", "rails", "ruby on rails", "jquery", "javascript", "php", "sql"]
@post = current_user.posts.build(post_params)
@post.tag_list = @existing_tag_list_array & @post.tag_list
if @post.tag_list.empty?
flash.now[:danger] = "Please select tag from list"
render "new"
else
respond_to do |format|
require 'rails_helper'
require 'spec_helper'
describe "User Registration" do
subject { page }
describe "signup page" do
before { visit new_user_registration_path }
let(:submit) { "Sign up" }
@tonkec
tonkec / application_controller.rb
Created March 12, 2016 15:13
Edit user with devise
def after_sign_out_path_for(resource)
new_user_session_path
end
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
<b>U:</b> <%= @u.title %>
<p id="notice"><%= notice %></p>
<h1>All Questions</h1>
<div class="questions-orders">
<%= sort_link(@q, :title) %>
<%= sort_link(@q, :created_at, "Created") %>
<%= sort_link(@q, :cached_votes_score, "Hearts") %>
</div>
<%= search_form_for @q do |f| %>
<%= search_form_for @q do |f| %>
<%= f.text_field :description_cont %>
<%= f.submit %>
<% end %>
@tonkec
tonkec / Samoborcek.md
Last active December 27, 2015 22:18
Samoborcek.md

Application plan

  • Shows when did last bus leave

  • By default app tells you when will the next bus arrive

  • Click button "I wanna go to Samobor" shows next bus for Samobor

@tonkec
tonkec / index.html
Created November 27, 2015 12:30
Swiper with angular
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css(.) styles/vendor.css -->
<!-- bower:css -->
@tonkec
tonkec / Flat designed responsive preloader.markdown
Last active September 14, 2015 10:41
Flat designed responsive preloader