Skip to content

Instantly share code, notes, and snippets.

@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
-- 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 */
#!/bin/bash
NOCOLOR='\e[0m'
REDCOLOR='\e[37;41m'
function usage {
code=${1:-0}
echo "Usage: $0 [-h] [-p] [-r] [-f] [-c] [-d css|js|f|b] [-e dev|prod] [project_name]
where:
@thoroc
thoroc / main.go
Last active August 29, 2015 14:15
codingame - Skynet: the Chasm
package main
import (
"fmt"
"os"
"strconv"
)
type Bike struct {
// speed of the bike
@thoroc
thoroc / main.go
Created February 16, 2015 23:36
codingame - Power of Thor
package main
import (
"fmt"
"bytes"
"os"
"strconv"
)
func main() {
@thoroc
thoroc / main.go
Created February 16, 2015 23:38
codingame - the Descent
package main
import "fmt"
import "os"
func main() {
for {
var SX, SY int
fmt.Scan(&SX, &SY)
var MAX int
@thoroc
thoroc / main.go
Created February 17, 2015 02:57
codingame - Mars Lander - Level 1
package main
import (
"fmt"
"strconv"
//"os"
)
type Point struct {
X, Y int
@thoroc
thoroc / main.go
Last active August 29, 2015 14:15
codingame - Temperature
package main
import (
"fmt"
"os"
"bufio"
"strconv"
)
func main() {