This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: User Photo | |
Plugin URI: http://wordpress.org/extend/plugins/user-photo/ | |
Description: Allows users to associate photos with their accounts by accessing their "Your Profile" page. Uploaded images are resized to fit the dimensions specified on the options page; a thumbnail image is also generated. New template tags introduced are: <code>userphoto_the_author_photo</code>, <code>userphoto_the_author_thumbnail</code>, <code>userphoto_comment_author_photo</code>, and <code>userphoto_comment_author_thumbnail</code>. Uploaded images may be moderated by administrators. | |
Version: 0.9.5.1 | |
Author: <a href="http://weston.ruter.net/">Weston Ruter</a> | |
Original code by Weston Ruter <http://weston.ruter.net> at Shepherd Interactive <http://shepherd-interactive.com>. | |
Continued development and maintenance by Dave Wagner (cptnwinky) <http://dev.dave-wagner.com/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/views/users/index.html.haml | |
%h1 Uporabniki | |
- # 1 uporabnik | |
= t(:user, count: 1) | |
- # 2 uporabnika | |
= t(:user, count: 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :figaro do | |
desc "SCP transfer figaro configuration to the shared folder" | |
task :setup do | |
transfer :up, "config/application.yml", "#{shared_path}/application.yml", via: :scp | |
end | |
desc "Symlink application.yml to the release path" | |
task :symlink do | |
run "ln -sf #{shared_path}/application.yml #{latest_release}/config/application.yml" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/application.rb | |
require File.expand_path('../boot', __FILE__) | |
require 'rails/all' | |
require File.dirname(__FILE__) + '/../lib/silent_logger.rb' | |
# Require the gems listed in Gemfile, including any gems | |
# you've limited to :test, :development, or :production. | |
Bundler.require(:default, Rails.env) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using [parity](https://github.com/thoughtbot/parity) | |
development restore production | |
development restore staging | |
# Steps for manual backup | |
heroku pg:backups capture --remote production | |
curl `heroku pg:backups public-url --remote production` > tmp/db.dump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec is absolutely flexible tool. One of its multitarget features is metadata. The main purpose of this feature is filtering and groupping examples by given attributes. You can found a lot of examples in article “Filtering examples in rspec-2”. | |
Recently I was faced with the need to test application behaviour depending on current subdomain. It was a group of examples so I need to use filters. Spec was similar to script below: | |
```ruby | |
feature "On custom subdomain", :subdomain => 'custom' do | |
scenario "homepage should change colorscheme to blue and use custom logo" do | |
... | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source by @Abs (http://stackoverflow.com/a/26855101) | |
module SoftDeletable | |
extend ActiveSupport::Concern | |
included do | |
default_scope { where(is_deleted: false) } | |
scope :only_deleted, -> { unscope(where: :is_deleted).where(is_deleted: true) } | |
end | |
def delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
parseFrameURL should point to this document. | |
Once the form is submitted it will: | |
- redirect to passwordResetSuccess if everything goes well | |
- redirect to invalidLink if data is invalid (eg. missing or invalid token, wrong email) | |
--> | |
<html> | |
<head></head> | |
<body> | |
<h1>Reset Your Password<span id='app'></span></h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this script to collection's pre-request scripts | |
// Collection -> Edit -> Pre-request Scripts | |
// Automatically fetch oAuth access_token and store it for 1 hour | |
update_token = pm.environment.get("token_time"); | |
if (typeof(update_token) == "undefined" || update_token <= Date.now()) { | |
console.log("Fetching new oAuth access token for user"); | |
pm.sendRequest({ | |
url: pm.environment.get("host") + pm.environment.get("token_path"), |
OlderNewer