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
#! /bin/bash | |
items="1 2 3 4 5 6" | |
pids="" | |
for item in $items; do | |
sleep $item & | |
pids+="$! " | |
done |
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
Show hidden characters
[ | |
{ | |
"keys": ["command+enter"], | |
"command": "delete_trailing_spaces" | |
}, | |
{ | |
"keys": ["command+shift+/"], | |
"command": "reveal_in_side_bar" | |
}, | |
{ |
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
env = ENV.fetch('APP_ENV', 'development') | |
begin | |
storage_config = YAML.load_file("#{Rails.root.to_s}/config/storage.yml")[env] | |
rescue Errno::ENOENT | |
message = ".config/storage.yml not found! Perhaps you forgot to copy it from storage.yml.example? (#{$!})" | |
raise $!, message, $!.backtrace | |
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
DELETE a, b, c | |
FROM | |
wp_posts a | |
LEFT JOIN | |
wp_term_relationships b ON(a.ID = b.object_id) | |
LEFT JOIN | |
wp_postmeta c ON(a.ID = c.post_id) | |
WHERE | |
a.post_type = 'post' AND DATEDIFF(NOW(), | |
a.post_date) > 600 |
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
Authentication: I am who I say I am | |
Authorization: What am I allowed to do? |
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 RegistrationsController < Devise::RegistrationsController | |
def create | |
super do |resource| | |
if resource.persisted? | |
resource.send_confirmation_instructions | |
end | |
end | |
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
server { | |
listen 80 default_server; | |
server_name _; | |
return 444; | |
} |
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
require 'action_mailer' | |
ActionMailer::Base.smtp_settings = { | |
address: 'smtp.yourserver.com', # default: localhost | |
port: '25', # default: 25 | |
user_name: 'user', | |
password: 'pass', | |
authentication: :plain # :plain, :login or :cram_md5 | |
} |
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
if ($('body').hasClass('admin_subscriptions')) { | |
$.post('/admin/users/1/subscriptions/get_subjects', function(data) { | |
$('body').data('subscription.subjects', data); | |
}); | |
$("#subscription_subject_type").on("change", function () { | |
var $select_type = $("#subscription_subject_type"), | |
$select_id = $("#subscription_subject_id"); | |
$("option[value]", $select_id).remove(); | |
$.each($('body').data('subscription.subjects'), function() { |