Skip to content

Instantly share code, notes, and snippets.

@joshellington
joshellington / kagi-darkmustard-theme.css
Last active April 13, 2024 22:25
A slightly refined, dark-focused, mobile-supported Kagi theme. Works best using Dark Theme, and either Moon Dark or Royal Blue.
: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;
--primary: #F2E6D7;
window.onclick=function() {
alert('wtf!');
}
@joshellington
joshellington / gist:5dadb27095e940314821
Created May 19, 2014 01:07
Backup your Github organization repos.
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

Templating in EE vs. Craft

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.

Table of Contents

  1. Comments
  2. Conditionals
  3. Loops
#!/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
#!/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
env RAILS_ENV=production DATABASE_URL=scheme://user:pass@127.0.0.1/dbname bundle exec rake assets:precompile 2>&1
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"
}
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