Skip to content

Instantly share code, notes, and snippets.

View tonkec's full-sized avatar
🚀
focusing

Antonija Šimić tonkec

🚀
focusing
View GitHub Profile
# 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
@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
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 / 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|
@tonkec
tonkec / Fullscreen background slideshow.markdown
Created April 10, 2016 07:31
Fullscreen background slideshow
class AvatarUploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
include CarrierWave::MiniMagick
if Rails.env.production?
storage :fog
else
class PostMailer < ApplicationMailer
def new_post_email(user_id)
puts "MAILER!!"
@user = User.find_by_id(user_id)
mail(to: @user.email, subject: 'New question has been asked!')
end
end
/*
BASIC GULPFILE FOR COMPILING SASS, MINIFYING CSS
AND RELOADING PAGE WITH BROWSERSYNC
*/
var gulp = require('gulp');
var Promise = require('es6-promise').Promise;
var sass = require('gulp-sass');
var rename = require('gulp-rename');
function a(k) {
var k,i,s,j;
for (i=1;i<=k;i++) {
s=0;
console.log("prva##############")
console.log("i je: " + i)
@tonkec
tonkec / Famous_female_coders.md
Last active November 14, 2018 10:29
Famous female coders