Skip to content

Instantly share code, notes, and snippets.

View ornj's full-sized avatar
💬
typing…

Stephen Hurwitz ornj

💬
typing…
View GitHub Profile
@ornj
ornj / li-speed-test.html
Created July 23, 2013 12:26
Zen Coding template to generate 10,000 lis formatted with CSS to appear as divs
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Speed Test</title>
<meta charset="UTF-8">
<script type="text/javascript" charset="utf-8">
var start = new Date().getTime() / 1000;
window.onload = function()
{
var end = new Date().getTime() / 1000;
@ornj
ornj / div-speed-test.html
Created July 23, 2013 12:24
Zen Coding template to generate 10,000 divs
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Speed Test</title>
<meta charset="UTF-8">
<script type="text/javascript" charset="utf-8">
var start = new Date().getTime() / 1000;
window.onload = function()
{
var end = new Date().getTime() / 1000;
@ornj
ornj / DeleteTagging.php
Created June 28, 2013 13:48
EventListener for removing entries in Taggable when using FabienPennequin/FPNTagBundle.
<?php
namespace Application\Bundle\TagBundle\EventListener;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Application\Bundle\TagBundle\Entity\Tag;
class DeleteTagging
{
public function preRemove(LifecycleEventArgs $args)
@ornj
ornj / drupalcon-thursday-notes.md
Created May 24, 2013 20:21
My notes from the third day of presentations at Drupalcon Portland 2013

#Notes from Drupalcon Portland, Thursday May 23, 2013

##Drupal Lifecycle Management, or How to Keep Your Dev Swagger After Launch

  • Fast solutions ignoring best practices often make problems worse
    • Series of small mistakes under pressure add up to a bigger problem.
    • Do not hack solutions together
  • Git
    • Use a "bare" repo to coordinate and run hooks
  • Deploy scripts can be written in any language that can be executed from the shell (php, rb, py, bash, whatever)
@ornj
ornj / drupalcon-wednesday-notes.md
Created May 23, 2013 17:56
My notes from the second day of presentations at Drupalcon Portland 2013

#Notes from Drupalcon Portland, Wednesday May 22, 2013

##General Drupal

##The Old And The New Field API In Drupal8

  • Field config and instances written to yaml files, do not need features to deploy
  • Field definitions missing widget and display
@ornj
ornj / drupalcon-tuesday-notes.md
Created May 21, 2013 22:52
My notes from the first day of presentations at Drupalcon Portland 2013

Notes from Drupalcon Portland, Tuesday May 21, 2013

General Drupal 8 Stuff

  • Top level libraries, modules, themes, and profiles directories are where you should put all shared modules. Core stuff is in core/
  • Hooks are replaced by annotations
  • Can have custom block types, blocks have fields now
  • Tour module lets you add hints as to what the UI/page is supposed to do

Future of Views

  • Views are saved to disk, not database.
@ornj
ornj / base.html
Created April 24, 2013 19:48
Modernizr < IE9 test. Some times you have to do what you have to do.
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class=""> <!--<![endif]-->
@ornj
ornj / Project.php
Last active February 4, 2022 12:48
ManyToMany / ManyToOne implemented with SonataAdminBundle and SonataMediaBundle.
<?php
namespace Acme\Bundle\ProjectBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Acme\Bundle\ProjectBundle\Entity\ProjectHasMedia;
/**
* Project
@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;
@ornj
ornj / _sprites.css
Last active December 12, 2015 01:58
Assetic Compass configuration
@import 'compass/utilities/sprites';
@import 'ui/*.png';
@include all-ui-sprites();