Skip to content

Instantly share code, notes, and snippets.

chris:infinitas deizel$ git checkout dev
Switched to branch 'dev'
Your branch and 'origin/dev' have diverged,
and have 1 and 25 different commit(s) each, respectively.
chris:infinitas deizel$ git pull --rebase
First, rewinding head to replay your work on top of it...
Applying: adding netbeans to .gitignore
chris:infinitas deizel$
@deizel
deizel / save_diff.php
Created March 29, 2011 17:33
Handles saving only fields that have been changed in a record by the logged in user
<?php
/**
* SaveDiff component
*
* Handles saving only fields that have been changed in a record by the logged in user.
*
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
class SaveDiffComponent extends Object {
/**
➜ joind.in git:(master) ✗ vagrant up
[default] Importing base box 'centos-62-64-puppet'...
[default] Matching MAC address for NAT networking...
[default] Clearing any previously set forwarded ports...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 80 => 8080 (adapter 1)
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Running any VM customizations...
@deizel
deizel / test.pp
Created May 11, 2012 20:22
joindin test suite
# Set development values to php.ini
augeas { 'set-apache-conf-values':
context => '/files/etc/httpd/conf/httpd.conf',
changes => [
'set EnableMMAP/param off',
'set EnableSendfile/param off',
],
require => Service['apache'],
#notify => Service['apache'], # circular dependency?
}
@deizel
deizel / backup.bat
Last active August 24, 2019 09:16
Robocopy - desktop archiver
@echo off
set robocopy=C:\Program Files\Windows Resource Kits\Tools\robocopy.exe
set source=C:\Documents and Settings\%username%\Desktop
set destination=%source%\backup\%date:~6,4%-%date:~3,2%
set exclude_dirs=backup downloads dropbox projects
set exclude_files=*.lnk *.bat
md "%backup%"
"%robocopy%" "%source%" "%destination%" /mov /e /xd %exclude_dirs% /xf %exclude_files% /xx
pause
@deizel
deizel / tail.php
Created October 6, 2012 22:08
PHP log tail example
<?php
if (isset($_GET['ajax'])) {
session_start();
$handle = fopen('/private/var/log/system.log', 'r');
if (isset($_SESSION['offset'])) {
$data = stream_get_contents($handle, -1, $_SESSION['offset']);
echo nl2br($data);
} else {
fseek($handle, 0, SEEK_END);
$_SESSION['offset'] = ftell($handle);
deizel@imac : ~/Development/stackoverflow
% cd 12787540-using-pear-xmlrpc2-inside-wordpress-plugin
deizel@imac : ~/Development/stackoverflow/12787540-using-pear-xmlrpc2-inside-wordpress-plugin
% mkdir -p wp-content/plugins/plugin_name/PEAR/
deizel@imac : ~/Development/stackoverflow/12787540-using-pear-xmlrpc2-inside-wordpress-plugin
% cd wp-content/plugins/plugin_name
deizel@imac : ~/Development/stackoverflow/12787540-using-pear-xmlrpc2-inside-wordpress-plugin/wp-content/plugins/plugin_name
@deizel
deizel / launcher.bat
Created November 9, 2012 00:13
Application launcher
@echo off
:go
echo What do you want to close?
echo.
echo 1. [D]esign
echo 2. [W]indows
echo 3. [M]usic
echo 4. [E]ntertainment
echo 5. [G]ames
@deizel
deizel / TestSuite\Fixture\SchemaFixture.php
Last active August 29, 2015 14:08
Auto-load fixture fields from Config/Schema/schema.php (depends on Migrations plugin)
<?php
App::uses('MigrationShell', 'Migrations.Console/Command');
/**
* Schema Reader - reads schema.php from disk
*
* Steals functionality from private method in Migrations.MigrationShell::_getSchema()
*/
class SchemaReader extends MigrationShell {
@deizel
deizel / cakephp.template
Created November 12, 2014 17:54
CakePHP template (for use with gelstudios/gitfiti project)
:cakephp
[[0,0,0,1,1,1,1,2,0,0,0,0,1,3,3,0,0,0,0,0,0,0,1,3,0,0,0,0,0,0,0,0,0,0,2,4,4,4,0,0,2,4,0,2,4,0,2,4,4,4,0,0],
[0,0,1,1,1,3,1,1,2,0,0,1,3,2,2,0,0,0,0,0,0,0,1,3,0,0,0,0,0,0,0,0,0,0,2,4,0,3,4,0,2,4,0,2,4,0,2,4,0,3,4,0],
[0,0,1,1,1,4,3,3,4,0,1,3,0,0,0,0,0,1,3,3,0,0,1,3,0,1,3,0,0,1,3,3,0,0,2,4,0,3,4,0,2,4,0,2,4,0,2,4,0,3,4,0],
[0,0,2,1,1,1,4,3,4,0,1,3,0,0,0,0,0,0,0,2,3,0,1,3,1,3,0,0,1,3,0,2,3,0,2,4,4,4,0,0,2,4,4,4,4,0,2,4,4,4,0,0],
[0,0,3,2,2,2,2,4,4,0,1,3,0,0,0,0,0,1,3,3,3,0,1,3,3,0,0,0,1,3,3,3,3,0,2,4,0,0,0,0,2,4,0,3,4,0,2,4,0,0,0,0],
[0,0,2,3,3,3,3,4,4,0,0,2,3,1,1,0,1,3,0,2,3,0,1,3,2,3,0,0,1,3,0,0,0,0,2,4,0,0,0,0,2,4,0,3,4,0,2,4,0,0,0,0],
[0,0,0,2,2,2,2,0,0,0,0,0,2,3,3,0,0,1,3,3,3,0,1,3,0,2,3,0,0,1,3,3,3,0,2,4,0,0,0,0,2,4,0,3,4,0,2,4,0,0,0,0]]