This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.smt.todo.model; | |
public class UnitOfWork { | |
private static UnitOfWork soleInstance = null; | |
private FinderInterface finder; | |
public static UnitOfWork getInstance() { | |
UnitOfWork.initialize(); | |
return UnitOfWork.soleInstance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function calculateDuration($startTime) | |
{ | |
$currTime = time(); | |
$diff = $currTime - $startTime; | |
if ($diff >= 3600) { | |
// hours | |
$difference = $diff/3600; | |
$difference = round($difference,0); | |
if ($difference>1) { $extra="s"; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var uploadInput = $('#fileUpload'); | |
var selectFileButton = $('#selectFileButton'); | |
var selectedFile = $('#selectedFile'); | |
var uploadProgress = $('#uploadProgress'); | |
var currentFile = ''; | |
function fileChanged(e, data) { | |
console.log(e,data); | |
if(data === undefined || !data.files.length) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://gist.github.com/saksmt/aac34dcfe0c5e94ce611 | |
source /usr/local/etc/colors.sh | |
function promt { | |
local questionAnswerVariants="["$green"Y"$clr"|"$red"n"$clr"]" | |
local ans="" | |
while true; do | |
echo -n $bright""$white""$1""$clr" "$questionAnswerVariants" " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
esc=`echo -en "\033"` | |
clr="${esc}[0m" | |
bright="${esc}[1m" | |
black="${esc}[30m" | |
red="${esc}[31m" | |
green="${esc}[32m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
_sf_console() | |
{ | |
local curr=${COMP_WORDS[COMP_CWORD]} | |
local out='' | |
local str=" | sed -r 's/\s+.*$//' | xargs" | |
if [[ -e "app/console" ]]; then | |
out="app/console list --raw"$str | |
else if [[ -e "console" ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
_composer() | |
{ | |
local curr=${COMP_WORDS[COMP_CWORD]} | |
COMPREPLY=( $(compgen -W "$(composer list --raw | sed -r 's/\s+.*$//' | xargs)" -- "$curr") ) | |
} | |
complete -F _composer composer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace FS\MyOnCallDocBundle\Model\Provider; | |
use Buzz\Browser; | |
use Doctrine\ORM\Query; | |
use Doctrine\ORM\QueryBuilder; | |
use Symfony\Component\Form\Form; | |
use FS\UserBundle\Entity\Patient; | |
use Symfony\Component\Form\FormFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace ForaSoft\ImproveClassBundle\Form\Type; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use Symfony\Component\OptionsResolver\OptionsResolverInterface; | |
class TagType extends AbstractType | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$modelTransformer = new TagsTransformer($this->manager); | |
$tags = $this->manager->getRepository('ForaSoftImproveClassBundle:Tag')->findAll(); | |
$builder->add( | |
$builder->create('tags', 'genemu_jqueryselect2_hidden', array( | |
'configs' => array( | |
'tags' => $modelTransformer->extractStrings($tags), | |
'tokenSeparators' => array(' ', ',', ';'), | |
), |