Skip to content

Instantly share code, notes, and snippets.

<?php
namespace Acme\AuditBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Acme\AuditBundle\Entity\AuditFormField;
use Acme\AuditBundle\Entity\AuditFormSection;
use Acme\AuditBundle\Form\Type\AuditFormFieldType;
@thoroc
thoroc / gist:7069593
Last active December 26, 2015 01:09
Samael.me.uk
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
.grid .tick line {
stroke: lightgrey;
opacity: 0.7;
@thoroc
thoroc / .bash
Last active May 12, 2017 17:12
Terminal config
##############################################################
# BASH_ALIASES
##############################################################
#-------------------------------------------------------------
# The 'ls' family
#-------------------------------------------------------------
alias ll='LANG=C ls -alF --group-directories-first'
alias ls='LANG=C ls -AhF --color' # add colors for filetype recognition
alias la='LANG=C ls -Al' # show hidden files
alias lx='LANG=C ls -lXB' # sort by extension
@thoroc
thoroc / getlibs
Created October 30, 2013 14:48 — forked from linuxundich/getlibs
#!/bin/bash
#The MIT License
#
#Copyright (c) 2007 Cappy
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
@thoroc
thoroc / RecordExporterController.php
Created November 13, 2013 13:21
trying to understand the difference between SF2 own session system and PHP default one
<?php
namespace Imbc\RecordBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class RecordExporterController extends Controller
{
@thoroc
thoroc / berzike.json
Created February 26, 2014 17:45
messing around with filtering in js
{
"name": "bezirke",
"limits": "gemeinden",
"enables": "",
"default": " >> Berzike",
"data": {
"charlottenburg-wilmersdorf": {
"name": "Charlottenburg-Wilmersdorf",
"value": "charlottenburg-wilmersdorf",
"limited-by": "BE"
<?php
namespace Acme\CalendarBundle\Worker;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\Common\Persistence\ObjectManager;
use Acme\EventBundle\Document\Event;
use Acme\EventBundle\Entity\Venue;
// not sure we need to save the sales figure in a DB
@thoroc
thoroc / gist:9970941
Last active December 24, 2017 17:57
A collection of Unix/Linux find command examples

source: http://alvinalexander.com/unix/edu/examples/find.shtml

basic 'find file' commands

find / -name foo.txt -type f -print             # full command
find / -name foo.txt -type f                    # -print isn't necessary
find / -name foo.txt                            # don't have to specify "type==file"
find . -name foo.txt                            # search under the current dir
-- for T-SQL / SQL server
-- see http://blog.sqlauthority.com/2008/08/06/sql-server-query-to-find-column-from-all-tables-of-database/
USE AdventureWorks
GO
SELECT t.name AS table_name,
SCHEMA_NAME(schema_id) AS schema_name,
c.name AS column_name
FROM sys.tables AS t
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
/*
* @source: http://anubhavg.wordpress.com/2009/06/11/how-to-format-datetime-date-in-sql-server-2005/
* Microsoft SQL Server T-SQL date and datetime formats
* Date time formats - mssql datetime
* MSSQL getdate returns current system date and time in standard internal format
*/
SELECT convert(varchar, getdate(), 100)
/* mon dd yyyy hh:mmAM (or PM) - Oct 2 2008 11:01AM */
SELECT convert(varchar, getdate(), 101)
/* mm/dd/yyyy - 10/02/2008 */