Skip to content

Instantly share code, notes, and snippets.

View cspray's full-sized avatar

Charles Sprayberry cspray

View GitHub Profile
@PeeHaa
PeeHaa / frameworks-sigh.md
Created May 7, 2012 22:27
Frameworks are bad m'kay

This document will be a reminder why most (/ almost all) frameworks out there just suck monkey balls.

Let's just make a nice list of all the really bad stuff that is happening in the popular frameworks.
And maybe publish it just to give people the shivers.

CodeIgniter

[Are we evaling now][2]?

@cspray
cspray / xdebug_ini_settings.php
Created May 14, 2012 14:04
Xdebug ini settings to show more info on var_dump
<?php
// Displays all array indices and object properties
ini_set('xdebug.var_display_max_children', -1);
// Displays all string data dumped
ini_set('xdebug.var_display_max_data', -1);
// Controls nested level displayed, maximum is 1023
ini_set('xdebug.var_display_max_depth', -1);
<!--
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░▄▄▄▄▀▀▀▀▀▀▀▀▄▄▄▄▄▄░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░█░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░▀▀▄░░░░░░░░░░░░░░░░░░░░░░░░
░░░░█░░░▒▒▒▒▒▒░░░░░░░░▒▒▒░░█░░░░░░░░░░░░░░░░░░░░░░░
░░░█░░░░░░▄██▀▄▄░░░░░▄▄▄░░░░█░░░░░░░░░░░░░░░░░░░░░░
░▄▀▒▄▄▄▒░█▀▀▀▀▄▄█░░░██▄▄█░░░░█░░░░░░░░░░░░░░░░░░░░░
█░▒█▒▄░▀▄▄▄▀░░░░░░░░█░░░▒▒▒▒▒░█░░░░░░░░░░░░░░░░░░░░
█░▒█░█▀▄▄░░░░░█▀░░░░▀▄░░▄▀▀▀▄▒█░░░░░░░░░░░░░░░░░░░░
░█░▀▄░█▄░█▀▄▄░▀░▀▀░▄▄▀░░░░█░░█░░░░░░░░░░░░░░░░░░░░░
@morrisonlevi
morrisonlevi / gist:4083664
Created November 16, 2012 03:13
ext/mysql deprecation email

Sirs, Gentlemen and Scholars,

I am appreciative of all of the discussion that has happened on the mysql_deprecation RFC (https://wiki.php.net/rfc/mysql_deprecation). It has helped me understand how we feel collectively about ext/mysql and how to deprecate it. I believe that clarifying what the term 'deprecation' means could help everyone to understand what we are trying to accomplish.

To quote wikipedia on the word 'deprecation':

In the process of authoring computer software, its standards or documentation, or other technical standards, deprecation is a status applied to features, characteristics, or practices to indicate that they should be avoided, typically because they have been superseded.

I think we all agree that ext/mysql should be avoided and that it has been superseded. What I want to point out is that deprecation is a process. The real question is: have we taken the proper steps in that process?

@cspray
cspray / cv-ring-description.md
Created January 27, 2012 15:55
A brief description of cv-ring and cv-pls

What is 'cv-ring', 'cv-pls' and 'delv-pls'

In the Stack Overflow PHP chat you may notice the regulars using tags like cv-pls, cv-ring and delv-pls. These tags are used only in the chat room to communicate with other users that a question or answer may need more votes to be closed or deleted. The PHP tag has a lot of inferior quality and duplicative information on Stack Overflow. We feel that inferior quality questions bring down the site and make it harder to find good information, particularly about PHP. By closing and merging these questions as appropriate you'll find the information you need quicker.

  • cv-ring is just a 'funny name' we give to the group of regulars who use the tags
  • cv-pls is an in-chat tag that communicates "Hey, this question may be of inferior quality. Check it out and, if you feel appropriate, cast a close vote."
  • delv-pls is an in-chat tag that communicates "Hey, this question has alr
@owainlewis
owainlewis / model_to_csv.rb
Created July 2, 2012 17:58
Export Rails model to CSV
# Export Active Record model as a CSV file
#
def self.render_csv active_record_model
CSV.generate do |csv|
csv << active_record_model.column_names
active_record_model.all.each do |m|
values = active_record_model.column_names.map{ |f| m.send f.to_sym }
csv << values
end
end
@Blackshawk
Blackshawk / blog - Explaining My Choices Further.md
Last active April 25, 2023 19:31
In which I do a little digging about the choices I've made with PHP. This is a long read, but it isn't something that can be explained in one or two paragraphs.

In the comments from my last post and on Twitter I noticed a lot of people who had something to say about PHP. The comments were varied but they usally sounded something like this (sorry @ipetepete, I picked yours because it was the shortest).

...the little bits of soul from all of us who've had to work on, and or maintain large PHP applications. – ipetepete

In Pete's defense, he did go on to say that rest of the stack I was using was a "smorgasbord of awesome". Thanks, Pete. I agree!

I would, however, like to take a little time to correct a misperception in the developer community about PHP. I recently got into this same... discussion... with Jeff Atwood, and I seem to be running into it more and more. So here goes. Please bear with me as I cover a little history further on.

Pete, and everybody else, _you're exactly rig

@loonies
loonies / 1_phpunit-api.md
Last active January 19, 2024 07:34
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()
@SabretWoW
SabretWoW / rspec_model_testing_template.rb
Last active March 7, 2024 03:56
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems: