This file contains hidden or 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 express = require('express') | |
, S = require('string') | |
, moment = require('moment') | |
, redis = require('redis') | |
, RedisStore = require('connect-redis')(express) | |
, rClient = exports.rClient = redis.createClient() | |
, sessionStore = exports.sessionStore = new RedisStore({client: rClient}) | |
, app = express() | |
, cfg = require('./config/app_conf') | |
, passport = require('passport') |
This file contains hidden or 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_action('wp_insert_post', 'wpexpo_on_publish'); | |
function wpexpo_on_publish($post_id){ | |
if ( !wp_is_post_revision( $post_id ) ) { | |
$post_status = get_post_status($post_id); | |
if($post_status == 'publish' and (isset($_POST['original_publish']) and $_POST['original_publish'] == 'Publish')){ | |
//codes here | |
} | |
} | |
} |
This file contains hidden or 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
function export_connect_csv(user_id, file_location){ | |
mysqlPool.getConnection(function(err, connection){ | |
var csv_row = "Email,First Name,Last Name,Status,Created\n"; | |
function processRow (row) { | |
var csv_row = row.email+','+row.first_name+','+row.last_name+','+row.status+','+row.created+"\n"; | |
fs.appendFile(file_location, csv_row, function (err) { | |
if(err){ | |
throw err; | |
} | |
}); |
This file contains hidden or 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
function export_connect_csv(user_id, res){ | |
ConnectModel.mysqlPool.getConnection(function(err, connection){ | |
res.header('Content-Type', 'text/csv'); | |
var csv_header_row = "Email,First Name,Last Name,Status,Created\n"; | |
res.write(csv_header_row); | |
var query = connection.query('SELECT * FROM connects where user_id = ? AND deleted = 0', [user_id]); | |
query | |
.on('error', function(err) { |
This file contains hidden or 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
function export_connect_csv(user_id, res){ | |
ConnectModel.mysqlPool.getConnection(function(err, connection){ | |
res.header('Content-Type', 'text/csv'); | |
var csv_header_row = "Email,First Name,Last Name,Status,Created\n"; | |
res.write(csv_header_row); | |
var query = connection.query('SELECT * FROM connects where user_id = ? AND deleted = 0', [user_id]); | |
query | |
.on('error', function(err) { |
This file contains hidden or 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
# Configuration file for varnish | |
# | |
# /etc/init.d/varnish expects the variables $DAEMON_OPTS, $NFILES and $MEMLOCK | |
# to be set from this shell script fragment. | |
# | |
# Should we start varnishd at boot? Set to "no" to disable. | |
START=yes | |
# Maximum number of open files (for ulimit -n) |
This file contains hidden or 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
# Default backend definition. Set this to point to your content server. | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8080"; | |
.connect_timeout = 60s; | |
.first_byte_timeout = 60s; | |
.between_bytes_timeout = 60s; | |
.max_connections = 800; | |
} |
This file contains hidden or 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
function bracesChecker(str) { | |
if(!str) { | |
return true; | |
} | |
var openingBraces = [’{’, ’[’, ’(’]; | |
var closingBraces = [’}’, ’]’, ’)’]; | |
var stack = []; | |
var openIndex; | |
var closeIndex; | |
//check for opening Braces in the val |
This file contains hidden or 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
/* | |
.DS_Store | |
!.gitignore | |
!wp-content/ | |
# Ignore everything in the "wp-content" directory, except the "plugins" | |
# and "themes" directories. | |
wp-content/* | |
!wp-content/plugins/ | |
!wp-content/themes/ |
This file contains hidden or 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: Taxonomy Sync | |
Version: 0.1 | |
*/ | |
// Taxonomies | |
$taxonomies_to_sync = array( 'an', 'array', 'of', 'taxonomies', 'to', 'sync' ); // Change These! | |
function ms_taxonomy_sync_add_menu() { |
OlderNewer