Skip to content

Instantly share code, notes, and snippets.

View irkanu's full-sized avatar

Dylan Ryan irkanu

View GitHub Profile
@irkanu
irkanu / createComment
Created March 17, 2015 01:00
please create a comment D:
$scope.createComment = function() {
// Attach current Article Object
var article = $scope.article;
// Create new Comment object
var comment = new Comments ({
body: this.body
});
<?php
/*
Plugin Name: GGA SSH2 Sample
Description: Sample SSH2 upload
Author: Pete Nelson (@GunGeekATX)
Version: 1.0
*/
if (!defined( 'ABSPATH' )) exit('restricted access');
@irkanu
irkanu / nginx-vhost
Last active August 29, 2015 14:12 — forked from GiovanniK/nginx-vhost
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;
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;
@irkanu
irkanu / setup-cron
Created November 3, 2014 22:33
Setup Cron to force onTransientUpdate to check hourly
/**
* 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 {
@irkanu
irkanu / gravity-form-upload-as-attachment.php
Created October 3, 2014 18:26
Gravity Form upload as attachment
// 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"));