Skip to content

Instantly share code, notes, and snippets.

View rissajeanne's full-sized avatar

Marissa Yuen rissajeanne

  • Agathon Group
  • Arizona, USA
View GitHub Profile
@rissajeanne
rissajeanne / Authentication-patch.patch
Last active November 12, 2021 17:48
Magento 2.4.3 patch for module
--- App/Action/Plugin/Authentication.php.orig
+++ App/Action/Plugin/Authentication.php
@@ -225,10 +225,9 @@
// Checks, whether secret key is required for admin access or request uri is explicitly set
if ($this->_url->useSecretKey()) {
- $requestParts = explode('/', trim($request->getRequestUri(), '/'), 3);
- $baseUrlPath = trim(parse_url($this->backendUrl->getBaseUrl(), PHP_URL_PATH), '/');
- $routeIndex = empty($baseUrlPath) ? 0 : 1;
- $requestUri = $this->_url->getUrl($requestParts[$routeIndex]);
@rissajeanne
rissajeanne / slack-customization.js
Last active July 6, 2017 21:26
Slack Customization
/**
* Append the following to /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
* Replace url with your own, or point to this url to responsively hide sidebar:
* https://gist.githubusercontent.com/rissajeanne/dc10be6272d223b778307dcd1d0028d9/raw/a6afd5fdac45e6b839da95c314acb3d8c7619553/slack-hide-sidebar.css
* Lastly, close and restart Slack
*
* Source: https://github.com/laCour/slack-night-mode/issues/73#issuecomment-287467332
*/
// Hides Slack sidebar if window is 720px or narrower
@rissajeanne
rissajeanne / slack-hide-sidebar.css
Last active October 19, 2018 19:17
Hide Slack Sidebar
/* Based on 0atman's solution
* http://www.0atman.com/remove-slacks-sidebar.html
*
* Thanks to:
* Tristram Oaten
* shaymdev
*/
/* Replace max-width with desired value */
@media (max-width: 600px) {
@rissajeanne
rissajeanne / some_controller.rb
Last active August 29, 2015 14:16
Rails whitelist of IPs
class SomeController < ApplicationController
before_filter :protect
def protect
allowed = ['127.0.0.1', '123.456.78.9']
if not allowed.include? request.remote_ip
# Render a 403 page
render(:file => File.join(Rails.root, 'public/403'), :status => 403, :layout => false)
return
end
@rissajeanne
rissajeanne / sass-structure
Last active December 30, 2015 00:58
Proposed Sass Organization for Bible Search
public/css/
languages/ # these need to be included individually as needed
ell.css
grc.css
mya.css
layout/
1140.scss
960.scss
@rissajeanne
rissajeanne / appcontroller.php
Created April 11, 2012 17:53
httpRefererMatchesBaseUrl()
<?php
private function httpRefererMatchesBaseUrl() {
if (!array_key_exists('HTTP_REFERER', $_SERVER) ||
!get_instance()->config->item('base_url')) {
return false;
}
$baseUrl = parse_url(get_instance()->config->item('base_url'));
$referer = parse_url($_SERVER['HTTP_REFERER']);
$cleanHttpReferer = $referer['host'];
<?php
/**
* Loop through translation directory for given locale, find all PO files,
* and generate key/value pairs from ids and strings therein.
*
* @return array
* @params boolean $default
* @author Marissa Hogue
*/
function i18nPOStrings($default = false) {
ABS.View.PassagePanelBrowse = Backbone.View.extend({
initialize : function() {
var that = this;
_.bindAll(this, 'render');
this.bind('passage:change', this.render);
},
render : function(options) {
var that = this;
ABS.Model.PassagePanel = Backbone.Model.extend({
initialize: function () {
this.updateBooks();
},
updateBooks: function () {
var that = this,
versions = new ABS.Collection.VersionList(ABS.bootstrap.versions),
getBookOrd = function (book) { return book.get('ord'); };
sortVersions: function() {
var getLang = function (ver) {
return ver.get('lang');
},
getLangAndAbbr = function (ver) {
return ver.get('lang') + ver.get('display_abbreviation');
};
this.sortedByLang = _.groupBy(this.sortBy(getLangAndAbbr), getLang);
}