Lots of people have asked, so here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft.
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
:root { | |
--font-main: "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; | |
--font-lufga: "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; | |
} | |
.theme_dark, .theme_moon_dark, .theme_moon_dark_conditional { | |
--app-bg: #181715; | |
--page-text: #F2E6D7; | |
--app-text: #F2E6D7; | |
--primary: #F2E6D7; |
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
window.onclick=function() { | |
alert('wtf!'); | |
} |
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 'github_api' | |
require 'optparse' | |
require 'pp' | |
options = {} | |
OptionParser.new do |opts| | |
opts.banner = "Usage: github_org_backup.rb [options]" | |
opts.on("-u", "--user USER", "Your Github username") do |v| | |
options[:user] = v |
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 | |
# Script to backup git repo to S3 | |
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars | |
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc | |
bucket=$GITHUB_BACKUP_BUCKET | |
dir=$GITHUB_BACKUP_DIR | |
password=$GITHUB_BACKUP_PASSWORD | |
account=$GITHUB_ACCOUNT |
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 | |
# A simple script to backup an organization's GitHub repositories. | |
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files | |
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up | |
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API) | |
GHBU_PASSWD=${GHBU_PASSWD-"<CHANGE-ME>"} # the password for that account | |
GHBU_GITHOST=${GHBU_GITHOST-"<CHANGE-ME>.github.com"} # the GitHub hostname (see comments) | |
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted | |
GHBU_PRUNE_AFTER_N_DAYS=${GHBU_PRUNE_AFTER_N_DAYS-3} # the min age (in days) of backup files to 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
env RAILS_ENV=production DATABASE_URL=scheme://user:pass@127.0.0.1/dbname bundle exec rake assets:precompile 2>&1 |
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
fb_query = { | |
:impressions => "SELECT value FROM insights WHERE object_id='#{post_id}' AND metric='post_impressions' AND period=0", | |
:impressions_unique => "SELECT value FROM insights WHERE object_id='#{post_id}' AND metric='post_impressions_unique' AND period=0", | |
:consumptions => "SELECT value FROM insights WHERE object_id='#{post_id}' AND metric='post_consumptions' AND period=0", | |
:consumptions_unique => "SELECT value FROM insights WHERE object_id='#{post_id}' AND metric='post_consumptions_unique' AND period=0", | |
:stories => "SELECT value FROM insights WHERE object_id='#{post_id}' AND metric='post_stories' AND period=0", | |
:storytellers => "SELECT value FROM insights WHERE object_id='#{post_id}' AND metric='post_storytellers' AND period=0", | |
:engaged_users => "SELECT value FROM insights WHERE object_id='#{post_id}' AND metric='post_engaged_users' AND period=0", | |
:negative_feedback => "SELECT value FROM insights WHERE object_id='#{post_id}' AND metric='post_negative_feedback' AND period=0" | |
} |
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
def save_thumb media_id | |
local_path = Rails.root.to_s + '/public/media_thumbs/thumbapp_' + media_id + '.png' | |
remote_path = 'http://emgklovf.rtmphost.com/http/thumbnail_app/thumbapp_'+media_id+'.png' | |
open(local_path, 'wb') do |file| | |
file << open(remote_path, :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE).read | |
end | |
end |
#Archive Process
##What you need
- Fresh clone of the git repo : zipped
- Screen shots of every unique page : in a folder zipped
- Folder with all (production) assets if not in repo : zipped
- Export of the Facebook insights : all exports
- Export of any other tracking data
- Dump of the database if needed : NO USER DATA
NewerOlder