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
<script src="https://cc.cdn.civiccomputing.com/8.0/cookieControl-8.0.min.js"></script> | |
<script> | |
var config = { | |
apiKey: '<API-KEY>', | |
product: 'PRO', | |
necessaryCookies: ['<GTM_COOKIE>'], // for GTM itself | |
optionalCookies: [{ | |
name: 'analytics', | |
label: 'Analytics', | |
description: 'We use cookies to track analytics and engagement with things like videos on our sites including Google Analytics, FullStory, and Spectate.', |
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
public void zipFiles(File folderToZip, String zipFileToCreate) | |
{ | |
ZipOutputStream zipStream = new ZipOutputStream(new FileOutputStream(zipFileToCreate)); | |
File[] files = folderToZip.listFiles(); | |
for (File file : files) | |
{ | |
String fileAbsolutePath = file.getAbsolutePath(); | |
String zipEntryName = fileAbsolutePath.substring(folderToZip.getAbsolutePath().length() + 1); | |
FileInputStream inputStream = new FileInputStream(file); | |
ZipEntry zipEntry = new ZipEntry(zipEntryName); |
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
<system-workflow-definition name="test" initial-step="initialize" > | |
<triggers> | |
<trigger name="email" class="com.cms.workflow.function.EmailProvider" /> | |
<trigger name="publish" class="com.cms.workflow.function.Publisher" /> | |
<trigger name="merge" class="com.cms.workflow.function.Merge" /> | |
<trigger name="assignStepIfUser" class="com.cms.workflow.function.AssignStepIfUser" /> | |
<trigger name="assignToGroupOwningAsset" class="com.cms.workflow.function.AssignToGroupOwningAsset" /> | |
<trigger name="assignToWorkflowOwner" class="com.cms.workflow.function.AssignToWorkflowOwner" /> | |
<trigger name="delete" class="com.cms.workflow.function.Delete" /> | |
<trigger name="deleteAndUnpublish" class="com.cms.workflow.function.DeleteAndUnpublish" /> |
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
cd /path/to/my/project | |
git branch rails_3_2_11_upgrade | |
vi Gemfile # Change: gem 'rails', "3.2.10" to: gem 'rails', "3.2.11" | |
bundle update rails | |
git commit -a -m "Upgrading Rails to 3.2.11 to fix security issues" | |
git push -u origin rails_3_2_11_upgrade | |
hub "Upgrade Rails to 3.2.11 to fix security issues" -b master # Create a PR from the branch; Note the issue number | |
hub browse user/project pull/<PULL_REQUEST_NUM> # Open it in the browser | |
# Merge that branch if you can! | |
# Let your CI server run your tests and deploy your changes |
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
# Query to get the file and associated blob data for all Files in a Site and to sum the length of the blobs to get the total byte size for all the files | |
select fc.id,b.id,octet_length(b.data), (sum(octet_length(b.data))/1024/1024) as "Total Bytes(MB)" from cxml_foldercontent fc left join cxml_blob b on fc.fileBlobId = b.id where siteId='<SITE_ID>' and assetType='FIL' and isCurrentVersion=1 order by octet_length(b.data) desc; | |
# Same as above, but does not sum and instead lists files in descending order by size | |
select fc.cachePath, b.id,octet_length(b.data) from cxml_foldercontent fc left join cxml_blob b on fc.fileBlobId = b.id where siteId='9a6807160a00016b00e06bc38171e0d5' and assetType='FIL' and isCurrentVersion=1 order by octet_length(b.data) desc; | |
# Same as first one except for Page and XML content |
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
# Output failed jobs by id with the delayed job type, associated ActiveRecord type, id, and method if applicable | |
Delayed::Job.where("failed_at is not null").select("id, handler, run_at, failed_at, last_error, job_type").order("id ASC").each { |j| puts "Id: #{j.id}\n DJ Type: #{$1 if j.handler =~ /!ruby\/struct:Delayed::(\w*) \n/}\n Failed at: #{j.failed_at}\n Object type: #{$1 if j.handler =~ /\nobject: !ruby\/(.*?)\s*\n/}\n Object Id: #{$1.to_i if j.handler =~ / id: (\d*)\n/}\n Method Name: #{$1 if j.handler =~ /\nmethod_name: (.*)\n/}\n Size: #{j.handler.size}\n\n\n"} | |
# Failed jobs | |
Delayed::Job.where('failed_at is not null') |