Skip to content

Instantly share code, notes, and snippets.

View ReactiveRaven's full-sized avatar

David Godfrey ReactiveRaven

View GitHub Profile
<?php
/***************
*
* My Wordpress plugin
*
*********************/
$myvar = "Hello";
function show_my_var(){
@ReactiveRaven
ReactiveRaven / gist:3101018
Created July 12, 2012 21:07
Example hooking jquery.form up to jqBootstrapValidation
$("...").ajaxForm({
beforeSubmit: function (arr, $form, options) {
if ($form.find(":input").jqBootstrapValidation("hasErrors")) {
return false; /* we just found errors, so don't submit yet */
}
}
});
$(/*...*/).jqBootstrapValidation(
{
submitSuccess: function ($form, event) {
$form.ajaxSubmit({ /* your jquery.form options here */ });
event.preventDefault(); // stops the browser from submitting the form and loading a new page
}
}
);
#!/bin/bash
apt-get -y -qq install google-chrome-stable netbeans compizconfig-settings-manager ntp
./server_packages.sh
<?php
// src/Acme/SubscriptionBundle/Entity/Transaction.php
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;
class Transaction
{
/**
* @Assert\Luhn(message = "Please check your credit card number.")
/**
* @Route("/user");
*/
class Users
{
/**
* @Route("/{user_slug}")
* @ParamConverter("user", options={"mapping": {"user_slug": "slug"}})
* @Template
* @Secure("ROLE_ADMIN")
@ReactiveRaven
ReactiveRaven / gist:7581801
Last active December 28, 2015 23:49
Questions

PHP

null == 0;
0 == "0x0";
null != "0x0";

Why?

JS

@ReactiveRaven
ReactiveRaven / gist:7641268
Last active December 29, 2015 08:09
Things to think about

Workstations

  • Desk
  • Chair
  • Display
  • Power
  • Stationery
  • Lighting

Personality

  • Benefits

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

@ReactiveRaven
ReactiveRaven / gist:8824407
Created February 5, 2014 14:14
downgrade php 5.5 to 5.4
# upgrade system, so you can add to ignore all updates later
sudo apt-get update
sudo apt-get upgrade
# remove your php, apache, etc
sudo apt-get purge apache2 php5 libapache2-mod-php5 # add here your server packages
# change repositories to raring (with backup)
sudo sed -i.bak "s/saucy/raring/g" /etc/apt/sources.list