Skip to content

Instantly share code, notes, and snippets.

View styks1987's full-sized avatar

styks1987

  • Sttark
  • Greenville, SC
View GitHub Profile
@styks1987
styks1987 / CropTransformer.php
Created February 19, 2013 14:19
Change lines 70-98 of the CropTransformer.php to allow the ability to directly pass coordinates for cropping.
if(!is_array($location)){
if ($widthScale > $heightScale) {
$src_w = round($width * $heightScale);
// Position horizontally in the middle
if ($location === self::CENTER) {
$src_x = round(($baseWidth / 2) - (($width / 2) * $heightScale));
// Position at the far right
} else if ($location === self::RIGHT || $location === self::BOTTOM) {
@styks1987
styks1987 / beforeSave.php
Last active December 13, 2015 23:08
before save
if(!empty($this->data['Image']['img_src_x1'])){
$options['transforms']['thumb']['location'] = array_values($this->data['Image']);
}
return $options;
@styks1987
styks1987 / script.js
Last active January 3, 2016 03:59
Tamper Monkey Script for ProWorkflow
// ==UserScript==
// @name Pro Workflow modifications
// @namespace https://proworkflow6.net/
// @version 0.1
// @description enter something useful
// @match https://proworkflow6.net/Merge/*
// @copyright 2012+, You
// ==/UserScript==
<VirtualHost *:80>
ServerAdmin template.email
ServerName template.url
DocumentRoot template.webroot
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
@styks1987
styks1987 / php.ini
Created October 31, 2014 02:44
Default INI for servers
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
require.config({
baseUrl:'/js/Dash',
shim: {
backbone: {
deps: [
"underscore",
"jquery"
],
exports: "Backbone"
},
@styks1987
styks1987 / Auth Only Request
Last active August 29, 2015 14:17
Authorize Auth + Prior Auth and Capture
<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name></name>
<transactionKey></transactionKey>
</merchantAuthentication>
<transactionRequest>
<transactionType>authOnlyTransaction</transactionType>
<amount>1563.00</amount>
<payment>
<creditCard>
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', $content['field_parent']['#entity_type']);
$query->entityCondition('bundle', $content['field_parent']['#bundle']);
$query->fieldCondition('field_parent', render($content['field_parent']));
$result = $query->execute();
public function __construct($id = false, $table = null, $ds = null) {
parent::__construct($id, $table, $ds);
$activities = new ActivityListener();
$this->getEventManager()->attach($activities);
}
AuthType Basic
AuthName "Testing-- Please Identify Yourself"
AuthUserFile /srv/auth/.htpasswd
Require valid-user
<Limit GET POST>
Require all denied
Require host 111.111.111.111
Require valid-user
</Limit>