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
- git clone https://github.com/LeoMcA/discourse-auth0-mozilla.git | |
- cd discourse-auth0-mozilla | |
- git checkout 2de31ec2442c4dabf4fc2561b6413b4651af65d4 | |
- cd ../ |
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
PostUpload.all.each do |post_upload| | |
Jobs.enqueue(:pull_hotlinked_images, post_id: post_upload.post.id) unless post_upload.post.nil? | |
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
#!/bin/sh | |
echo "What should this computer be called?" | |
read this_name | |
echo "What should the other computer be called?" | |
read that_name | |
echo "What's the hostname of the other computer?" | |
read that_hostname | |
echo "What's the path to the respository on this computer?" | |
read this_path |
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
SELECT replace(replace(replace(replace(replace(cast(notification_level AS varchar), '0', 'muted'), '1', 'regular'), '2', 'tracking'), '3', 'watching'), '4', 'watching first post') AS notification_level, count(*) FROM category_users WHERE category_id=(SELECT id FROM categories WHERE slug='development' AND parent_category_id=(SELECT id FROM categories WHERE slug='add-ons' AND parent_category_id IS NULL)) GROUP BY notification_level; |
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
[Desktop Entry] | |
Version=1.0 | |
Name=Nightly | |
GenericName=Web Browser | |
Comment=Browse the Web | |
Exec=/home/leo/.local/bin/nightly -P default-nightly %u | |
Icon=/home/leo/.local/share/nightly/browser/chrome/icons/default/default128.png | |
Terminal=false | |
Type=Application | |
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; |
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 'cgi' | |
require 'active_support' | |
require 'json' | |
# def verify_and_decrypt_session_cookie(cookie, secret_key_base = Rails.application.secret_key_base) | |
# cookie = CGI::unescape(cookie) | |
# # salt = 'authenticated encrypted cookie' | |
# salt = Rails.application.config.action_dispatch.encrypted_signed_cookie_salt | |
# encrypted_cookie_cipher = 'aes-256-gcm' | |
# serializer = ActiveSupport::MessageEncryptor::NullSerializer |
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/sh | |
A= B= ; qpdf --empty --collate --pages $A $B z-1 -- out.pdf |
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
const fetch = require("node-fetch") | |
const cheerio = require("cheerio") | |
const url = "https://www.bbc.co.uk/news/topics/crjeqkdevwvt/the-uks-european-elections-2019" | |
var leave = [{ name: "Leave", value: 0 }] | |
var remain = [{ name: "Remain", value: 0 }] | |
var lexit = [{ name: "???", value: 0 }] | |
var other = [{ name: "Other", value: 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
// paste in console, give aspect ratio as the argument, here 2.2 is the aspect ratio of the source material | |
(x => document.querySelector(".VideoContainer video").style.height = `${x * 9 / 16 * 100}%`)(2.2) |
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
# frozen_string_literal: true | |
# paste this file into /var/www/discourse/lib/tasks/mozilla.rake | |
# then run it with: rake mozilla:rebake_posts_with_upload["example.s3.dualstack.us-west-2.amazonaws.com"] | |
require "db_helper" | |
require "file_store/s3_store" | |
task "mozilla:rebake_posts_with_upload", [:s3_host] => :environment do |t, args| | |
s3_host = args[:s3_host] |