This file contains hidden or 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
FROM nginx:stable-alpine | |
COPY dist /usr/share/nginx/html | |
EXPOSE 80 | |
CMD ["nginx", "-g", "daemon off;"] |
This file contains hidden or 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
# new file app/controllers/users/passwords_controller.rb | |
class Users::PasswordsController < Devise::PasswordsController | |
def edit | |
super | |
raw, enc = Devise.token_generator.generate(User, :reset_password_token) | |
original_enc = Devise.token_generator.digest(User, :reset_password_token, params[:reset_password_token]) | |
EncoreBackend::User.where(reset_password_token: original_enc).update_all(reset_password_token: enc) | |
@user.reset_password_token = raw | |
end | |
end |
This file contains hidden or 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
client = Twitter::REST::Client.new do |config| | |
config.consumer_key = ENV['twitter_bot_consumer_key'] | |
config.consumer_secret = ENV['twitter_bot_consumer_secret'] | |
config.access_token = ENV['twitter_bot_access_token'] | |
config.access_token_secret = ENV['twitter_bot_access_token_secret'] | |
end | |
client.direct_messages(count: 200).each do |message| | |
if message.full_text =~ /uses TrueTwit validation. To validate click here/ | |
puts "Don't even... #{message.full_text}" |
This file contains hidden or 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
$ip=((gwmi Win32_NetworkAdapterConfiguration | ? { $_.IPAddress -ne $null }).ipaddress | select -First 1) | |
$ipAddressName = $ip.Replace(".","-") | |
If ($env:COMPUTERNAME -eq $ipAddress) { echo $ipAddressName; echo "No need to change" } else { netdom renamecomputer "$env:COMPUTERNAME" /Newname $ipAddressName /REBoot 10 } |
This file contains hidden or 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 'mechanize' | |
#Usage: ruby -rubygems skymiles.rb 123456789 1234 smith | |
acct = ARGV[0] | |
pin = ARGV[1] | |
lastName = ARGV[2] | |
@agent = Mechanize.new | |
page = @agent.get("http://www.delta.com/skymiles/manage_account/index.jsp") |
This file contains hidden or 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
# To do this, we call this from the deployment rake task: | |
DEPLOY_TAG = 'last-deploy' | |
# Tag & comment new issues that have been deployed | |
previous_deploy, current_deploy, issues = deploy_issues | |
#which calls this method: | |
def deploy_issues | |
update_branch('master') | |
NewerOlder