Skip to content

Instantly share code, notes, and snippets.

<?php if (!defined('APPLICATION')) exit();
// Define the plugin:
$PluginInfo['RssFeed'] = array(
'Description' => 'This simple plugin for new discussions and discussions updates',
'Version' => '1.0',
'RequiredApplications' => FALSE,
'RequiredTheme' => FALSE,
'RequiredPlugins' => FALSE,
'HasLocale' => TRUE,
@henare
henare / github_issues_to_csv.rb
Created July 26, 2011 05:00
Exports Github issues to CSV so it can be imported into Jira
require 'json'
require 'open-uri'
require 'csv'
require 'date'
# Github credentials to access your private project
USERNAME="myusername"
PASSWORD="mypassword"
# Project you want to export issues from
@jeduan
jeduan / reveal_ajax.js
Created February 9, 2012 00:15
Use Zurb reveal with ajax
$('a.reveal').click(function(event) {
event.preventDefault();
var $div = $('<div>').addClass('reveal-modal').appendTo('body'),
$this = $(this);
$.get($this.attr('href'), function(data) {
return $div.empty().html(data).append('<a class="close-reveal-modal">&#215;</a>').reveal();
});
});
@matthewpizza
matthewpizza / install-composer.sh
Created February 13, 2014 03:55
Install Composer on Webfaction
cd $HOME
ln -s `which php54` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php54
echo -e "\n# Composer\nalias composer=\"php54 \$HOME/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile
@jsor
jsor / ddd_cqrs_event-sourcing_in_php.md
Last active April 23, 2024 19:48
DDD, CQRS and Event Sourcing in PHP

DDD, CQRS and Event Sourcing in PHP

  • Broadway - Infrastructure and testing helpers for creating CQRS and event sourced applications
  • EventCentric.Core - Event Sourcing and CQRS in PHP
  • LiteCQRS - Small convention based CQRS library for PHP
  • predaddy - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
  • ProophEventSourcing - Provides basic functionality for event-sourced aggregates
  • ProophEventStore - PHP 5.4+ EventStore Implementation
  • ProophServiceBus - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
@davestewart
davestewart / start server.applescript
Created August 25, 2014 12:12
Start Server Apple Script
# Starts server in current folder
tell application "Finder"
set currentDir to POSIX path of ((container of (path to me)) as text)
end tell
tell application "Terminal" to activate
tell application "Terminal"
do script ("cd '" & currentDir & "'")
@othiym23
othiym23 / npm-upgrade-bleeding.sh
Created September 20, 2014 19:36
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@brianlmoon
brianlmoon / socket_connect_timeout.php
Last active February 26, 2021 06:13
Using socket_connect with a reliable timeout in PHP
<?php
/**
* I was having trouble with socket connections timing out reliably. Sometimes,
* my timeout would be reached. Other times, the connect would fail after three
* to six seconds. I finally figured out it had to do with trying to connect to
* a routable, non-localhost address. It seems the socket_connect call would
* not fail immediately for those connections. This function is what I finally
* ended up with that reliably connects to a working server, fails quickly for
* a server that has an address/port that is not reachable and will reach the
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@mindplay-dk
mindplay-dk / session-life-cycle.md
Last active March 28, 2024 19:52
Complete overview of the PHP SessionHandler life-cycle

This page provides a full overview of PHP's SessionHandler life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and what you can expect will be called in your custom SessionHandler implementation.

Each example is a separate script being run by a client with cookies enabled.

To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().