Skip to content

Instantly share code, notes, and snippets.

Reversibles

Set by Tom Smith and Michael Cronnelly

Languages Allowed

  • JavaScript

Problem

Some positive integers n have the property that the sum of (n + reverse(n)) consists entirely of odd digits.

create : {
contentId: 'fefewfew',
userId: [optional]
}
get : contentId, userId
[{
contentId: 'blah'
count: 10,
userLiked: true
@IamSmith
IamSmith / student-doctrine-orm-example.php
Created May 28, 2012 07:43
Student Doctrine ORM Example
<?php
/**
* @ORM\Entity
* @ORM\Table(name="student")
*
*/
class Student {
/**
@IamSmith
IamSmith / FullExample.php
Created April 8, 2011 17:53
Fully working example
<?php
require_once("PHPExcel/PHPExcel.php");
$phpExcel = new PHPExcel();
$styleArray = array(
'font' => array(
'bold' => true,
)
);
@IamSmith
IamSmith / output.php
Created April 5, 2011 08:30
Output as a download
<?php
$phpExcel = new PHPExcel();
$phpExcel->getActiveSheet()->setTitle("My Sheet");
$phpExcel->setActiveSheetIndex(0);
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"filename.xls\"");
header("Cache-Control: max-age=0");
$objWriter = PHPExcel_IOFactory::createWriter($phpExcel, "Excel5");
@IamSmith
IamSmith / FluentExample.php
Created April 5, 2011 07:58
Fluent example
<?php
$sheet->setCellValue("A1", "Text")
->setCellValue("A2", "Text")
->setCellValue("A3", "Text")
->setCellValue("A4", "Text")
->setCellValue("A5", "Text");
<?php
$sheet->setCellValue("A1", "Text");
$sheet->setCellValue("A2", "Text");
$sheet->setCellValue("A3", "Text");
$sheet->setCellValue("A4", "Text");
$sheet->setCellValue("A5", "Text");
@IamSmith
IamSmith / gist:902216
Created April 4, 2011 19:12
Output a PHPExcel file
<?php
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename=" ' . "Report" . '.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;