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
Verifying my Blockstack ID is secured with the address 18nsbj4hQKPv8wY3ih4hToN8Rgms9PxXns https://explorer.blockstack.org/address/18nsbj4hQKPv8wY3ih4hToN8Rgms9PxXns |
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
class VideoWorker | |
include Sidekiq::Worker | |
def perform(id, s3_key) | |
# Get the video | |
video = Video.find(id) | |
# Call ffmpeg to measure duration | |
duration = `ffmpeg -i '#{video.ffmpeg_url}' 2>&1 | grep Duration | awk '{print $2}' | tr -d ,` |
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 tax exempt fields to checkout | |
**/ | |
add_action('woocommerce_before_order_notes', 'taxexempt_before_order_notes'); | |
function taxexempt_before_order_notes( $checkout ) { | |
woocommerce_form_field( 'tax_exempt_checkbox', array( | |
'type' => 'checkbox', | |
'class' => array('tiri taxexempt'),array( 'form-row-wide', 'address-field' ), |
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
# Creates 'x' categorizations with null category_id's | |
def create | |
@user = current_user | |
@post = @user.posts.create(params[:post]) | |
@categories = @user.categories.all | |
@post.categorizations.build(:category_id => params[:categorization_ids]) | |
params[:categorization_ids].each do |categorization| | |
@post.categorizations.build(params[:categorization_id]) | |
end | |
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
#### User Model #### | |
class User < ActiveRecord::Base | |
devise :database_authenticatable, :registerable, :confirmable, | |
:recoverable, :rememberable, :trackable, :validatable | |
attr_accessible :email, :password, :password_confirmation, | |
:remember_me, :username, :profile_image, | |
:first_name, :last_name |
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
class User < ActiveRecord::Base | |
attr_accessible :email, :password, :password_confirmation, :remember_me, :username, :profile_image, :first_name, :last_name | |
has_many :publications | |
has_many :threads, :through => :publications | |
end | |
class Publication < ActiveRecord::Base | |
attr_accessible :thread_id, :user_id | |
belongs_to :thread | |
belongs_to :user |
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
class User < ActiveRecord::Base | |
has_many :subscriptions | |
has_many :threads, :through => :subscriptions | |
has_many :threads | |
end | |
class Thread < ActiveRecord::Base | |
has_many :subscriptions | |
has_many :users, :through => :subscriptions | |
belongs_to :user |
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
switch($post->post_type): | |
case "glossary": | |
$type_value = 1; | |
break; | |
case "page": | |
$type_value = 2; | |
break; | |
case "book_section": | |
$type_value = 3; | |
break; |
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
$(document).ready(function(){ | |
var topdivPos = $(".table-top").position(); | |
$(".table-bottom").css("position","absolute").css("top",topdivPos.top).css("left",topdivPos.left).show(); | |
$(".table-top").scroll(function(){ | |
$(".table-bottom").scrollTop($(".table-top").scrollTop()); | |
}); | |
}); |
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 | |
if ( is_user_logged_in() ) { | |
$user = new WP_User( $user_ID ); | |
if ( !empty( $user->roles ) && is_array( $user->roles ) ) { | |
foreach ( $user->roles as $role ) | |
echo $role; | |
} | |
} | |
?> |
NewerOlder