Skip to content

Instantly share code, notes, and snippets.

View velosipedist's full-sized avatar

Nick Konev velosipedist

View GitHub Profile
@kassadin
kassadin / colors.py
Created May 28, 2017 05:24 — forked from sheljohn/colours-old.py
Print with colors in most shells (Python, standalone)
class ColorPrinter:
"""
Usage:
cprint = ColorPrinter()
cprint.cfg('c','m','bux').out('Hello','World!')
cprint.rst().out('Bye now...')
See: http://stackoverflow.com/a/21786287/472610
See: https://en.wikipedia.org/wiki/ANSI_escape_code
"""
@butlerblog
butlerblog / test_wp_mail.php
Last active August 25, 2019 03:25
File for testing the wp_mail function http://b.utler.co/9L
<?php
/**
* This file can be used to validate that the WordPress wp_mail() function is working.
* To use, change the email address in $to below, save, and upload to your WP root.
* Then browse to the file in your browser.
*
* For full discussion and instructions, see the associated post here:
* http://b.utler.co/9L
*
* Author: Chad Butler
@barryvdh
barryvdh / _ide_helper.php
Last active May 6, 2024 07:45
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@ornj
ornj / ClientCreateCommand.php
Created March 1, 2013 00:12
Symfony2 command for creating a Client for FOSOAuthServerBundle
<?php
namespace Acme\Bundle\OAuthBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@ramonornela
ramonornela / build_xml.php
Created December 18, 2012 21:11
Geração XML Joomla
<?php
define('DIR_COMP', '<path>');
$objects = new RecursiveIteratorIterator(
new RecursiveRegexIterator(
new RecursiveDirectoryIterator(DIR_COMP),
'/^(?!.*(\.svn|\.cvs)).*$/',
RecursiveRegexIterator::MATCH
),
RecursiveIteratorIterator::SELF_FIRST
@hakre
hakre / iteration-and-recursive-iteration.php
Created September 2, 2012 14:26
Iteration and Recursive Iteration Examples Code
<?php
/*
* Iteration and Recursive Iteration Examples Code
*
* @link http://stackoverflow.com/questions/12077177/how-does-recursiveiteratoriterator-works-in-php
* @author hakre <http://hakre.wordpress.com>
*/
### To have these examples to work, a directory with subdirectories is needed,
### I named mine "tree":
<?xml version="1.0"?>
<project name="Hello World Example" default="build" description="This is an example buildfile for Phing.">
<target name="prepare">
<delete dir="reports"/>
<mkdir dir="reports/coverage"/>
</target>
<target name="build" depends="prepare">
<coverage-setup database="reports/coverage.db">
-- PostgreSQL cheat sheet
--postgres is set up to use local.6 which is syslog'd to sflog001
--slow query log is /var/log/localmessages
--config files are always in /data/friend/*.conf
--vacuums are set via cfengine, we use both manual and auto. vacuums/analyze help with frozen id's being recouped, and thus TX'id's not going over 2b thus causing massing shutdown/reset. Fix it to exp/imp high TX tables.
--to log into psql: psql -U postgres -d <DB> (usually friend)