Skip to content

Instantly share code, notes, and snippets.

View jeserkin's full-sized avatar

Eugene Serkin jeserkin

View GitHub Profile
Table `questions`
----------------
id | question
1 asdasdads..
2 asdasdasda..
3 asdasdas...
Table `answers`
----------------
id | answer | correct ('Y','N')
<?php
$sample = array(
'pictures' => array(
'name' => array(
1 => array(
1 => 'Chrysanthemum.jpg',
2 => 'Desert.jpg',
),
2 => array(
<?php
class UploadedFile
{
/**
* @var string
*/
protected $name;
/**
* @var string
Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File: /etc/php5/cli/php.ini
Scan for additional .ini files in: /etc/php5/cli/conf.d
Additional .ini files parsed: /etc/php5/cli/conf.d/10-pdo.ini,
/etc/php5/cli/conf.d/20-mysql.ini,
/etc/php5/cli/conf.d/20-mysqli.ini,
/etc/php5/cli/conf.d/20-pdo_mysql.ini,
/etc/php5/cli/conf.d/20-xdebug.ini
Ticket.controller('CloseTicketCtrl', ['$scope', '$http', '$location', '$log', function($scope, $http, $location, $log)
{
$scope.methodName = 'POST';
$scope.url = '/?show=ticket&ticket_id=';
$scope.close = function(ticketId)
{
$http({
method: $scope.methodName,
url: $scope.url + ticketId,
@jeserkin
jeserkin / gist:6834541
Created October 4, 2013 23:35
Snippet for default panel wraped by container
div.container>div.panel.panel-default>div.panel-heading+div.panel-body
<?php
public function getUniqueQuestions( $entryId, $limit = 30, array $excludeQuestions = array() )
{
$Query = $this->getEntityManager()->createQueryBuilder()
->select( 'q' )
->from( 'Application\Entity\QuestionsToQuizzes', 'qtq' )
->innerJoin( 'qtq.question', 'q' )
->innerJoin( 'qtq.quiz', 'qz' )
->where( 'qz.entry = :entry' )
<?php
namespace Some\Test\That\Is\Here;
class Foo
{
const
SOME_VALUE = 1;
}
module
.directive('onVisible', function()
{
return {
restrict: 'A',
scope: {
functionName: '='
},
link: function(scope, element, attrs)
{
.factory('Helper', function()
{
return (function()
{
this.validateJson = function(jsonObject)
{
try
{
JSON.stringify(jsonObject);
return true;