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
// gform_notification_FORMID, custom_function | |
add_filter('gform_notification_1', 'gfuaa_upload_attachment', 10, 3); | |
// http://gravityformspdfextended.com/topic/file-upload-as-attachments/ | |
function gfuaa_upload_attachment( $notification, $form, $entry ) { | |
//There is no concept of user notifications anymore, so we will need to target notifications based on other criteria, such as name | |
if($notification["name"] == "Admin Notification"){ | |
$fileupload_fields = GFCommon::get_fields_by_type($form, array("fileupload")); |
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
/** | |
* Building Cron-based hook to run periodic update checks and inject update info | |
* into WP data structures. | |
*/ | |
public function setupCron(){ | |
if ( $this->enableAutomaticChecking ) { | |
if ( !wp_next_scheduled('onTransientUpdate') ) { | |
wp_schedule_event(time(), 'hourly', array($this, 'onTransientUpdate')); | |
} | |
} else { |
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
server { | |
server_name domain.com; | |
listen 443 ssl spdy; | |
root /home/webmaster/www/domain.com; | |
index index.php index.html; | |
# SSL configuration | |
ssl_certificate /home/webmaster/certs/domain.com.crt; | |
ssl_certificate_key /home/webmaster/certs/domain.com.key; |
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
fastcgi_cache_path /etc/nginx/cache levels=1:2 keys_zone=Nginx:100m inactive=60m; | |
fastcgi_cache_key "$scheme$request_method$host$request_uri"; | |
server { | |
listen 80; | |
server_name nginx.dev; | |
access_log /var/log/nginx/nginx.access.log; | |
root /var/www/nginx.dev/public/; | |
index index.html index.php; |
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
<?php | |
/* | |
Plugin Name: GGA SSH2 Sample | |
Description: Sample SSH2 upload | |
Author: Pete Nelson (@GunGeekATX) | |
Version: 1.0 | |
*/ | |
if (!defined( 'ABSPATH' )) exit('restricted access'); |
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
$scope.createComment = function() { | |
// Attach current Article Object | |
var article = $scope.article; | |
// Create new Comment object | |
var comment = new Comments ({ | |
body: this.body | |
}); |
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
/** | |
* Create a new Comment | |
*/ | |
exports.create = function(req, res) { | |
var comment = new Comment(req.body); | |
comment.poll = req.poll._id; | |
// if user |
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
'use strict'; | |
/** | |
* Module dependencies. | |
*/ | |
var mongoose = require('mongoose'), | |
Schema = mongoose.Schema; | |
/** | |
* Article Schema |
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
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/test'); | |
var Cat = mongoose.model('Cat', { name: String }); | |
var kitty = new Cat({ name: 'Zildjian' }); | |
kitty.save(function (err) { | |
if (err) | |
console.log('meow'); | |
}); |
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
add_filter( 'woocommerce_prevent_admin_access', 'sfwd_check_admin_access' ); | |
function sfwd_check_admin_access( $redirect_to ) { | |
$user = wp_get_current_user(); | |
$allowed_roles = array ( 'administrator', 'group_leader' ); | |
if( is_array( $user->roles ) && in_array( $allowed_roles[0] , $user->roles ) || in_array( $allowed_roles[1] , $user->roles ) ) { | |
return false; | |
} |
OlderNewer