Skip to content

Instantly share code, notes, and snippets.

@rmcfrazier
rmcfrazier / atomic.h
Last active February 18, 2022 05:30
BerkeleyDB atomic.h patch to fix a build error when trying to compile LItecoin Core with wallet support
--- atomic.h 2010-04-12 13:25:22.000000000 -0700
+++ atomic.h.change 2022-02-17 21:08:50.281378426 -0800
@@ -144,7 +144,7 @@
#define atomic_inc(env, p) __atomic_inc(p)
#define atomic_dec(env, p) __atomic_dec(p)
#define atomic_compare_exchange(env, p, o, n) \
- __atomic_compare_exchange((p), (o), (n))
+ __atomic_compare_exchange_db((p), (o), (n))
static inline int __atomic_inc(db_atomic_t *p)
{
@rmcfrazier
rmcfrazier / rsync.xml
Created July 3, 2012 21:40
Ant builder to rsync on save in eclipse
<?xml version="1.0" encoding="UTF-8"?>
<project name="Rsync On Save" basedir="." default="rsync">
<description>Builder for eclipse to rsync on save for OSX.</description>
<!-- local source directory for rsync (read from this directory) -->
<property name="rsync.source.dir" value="${basedir}"/>
<!-- remote rsync host -->
<property name="rsync.destination.host" value="remote.example.com"/>
wget http://mirror.ox.ac.uk/sites/rsync.apache.org/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
sudo tar xzf apache-maven-3.0.5-bin.tar.gz -C /usr/local
cd /usr/local
sudo ln -s apache-maven-3.0.5 maven
mkdir libext
cd libext
wget http://extjs.com/deploy/ext-2.2.zip
export DSE_LIB=/usr/share/dse
@rmcfrazier
rmcfrazier / pending_review_notifier.php
Created July 21, 2012 00:04
Use this class to create a plugin that will send an email when a post goes into pending review status. It should be noted that auto-save has to be turned off, if not multiple emails will be sent. The class handles turning off auto-save.
class PendingReviewNotifier
{
private $_email_sent_flag = false;
public function run()
{
// add notification action to save_post hook
add_action('save_post', array(&$this, 'send_pending_review_notice'));
// add disable autosave hook