Skip to content

Instantly share code, notes, and snippets.

View dwgebler's full-sized avatar

dwgebler

View GitHub Profile
@dwgebler
dwgebler / doctrinemap.php
Created April 5, 2018 22:17
Generate Symfony 4 entities + repositories from existing database
<?php
include './vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
class RepoGen extends Doctrine\ORM\Tools\EntityRepositoryGenerator {
protected static $_template =
<?php
// Our slot will be 3 reels, one win line, with 3 symbols.
// X, BAR and 7.
// 0 = X, 1 = BAR, 2 = 7
// This is the layout of the reels, running vertically. There are 20
// symbols on each reel.
$reels = [
// reel 1 has 10 X's, 7 Bars and 3 7s
[0,1,0,1,0,1,0,1,2,2,1,0,1,0,0,0,0,2,1,0],
#!/usr/bin/env python
import urllib
import argparse
import sys
from xml.etree import ElementTree
def getXML(**url_args):
url_params = {
Failed to obtain
Traceback (most recent call last):
File "/root/.local/lib/python2.6/threading.py", line 504, in __bootstrap
self.__bootstrap_inner()
File "/root/.local/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/root/.local/lib/python2.6/threading.py", line 484, in run
self.__target(*self.__args, **self.__kwargs)
--- ---
File "/root/.local/lib/python2.6/site-packages/Twisted-12.1.0-py2.6-freebsd-8.2-RELEASE-amd64.egg/twisted/python/threadpool.py", line 167, in _worker