Skip to content

Instantly share code, notes, and snippets.

View d4r5c0d3's full-sized avatar

d4r5c0d3

View GitHub Profile
@d4r5c0d3
d4r5c0d3 / hhvm.service
Last active July 17, 2016 18:04
systemd conf file for running hhvm with differed group
[Unit]
Description=HipHop Virtual Machine
[Service]
User=apache
Group=www-data
PIDFile=/var/run/hhvm/hhvm.pid
ExecStart=/usr/local/bin/hhvm -m daemon -c /etc/hhvm/www.ini
ExecStop=/usr/bin/rm -f /var/run/hhvm/hhvm.pid
/**
* Caches the return value of get accessors and methods.
*
* Notes:
* - Will reset the get accessor cache if a new value is set.
* - Doesn't really make sense to put this on a method with parameters
*/
export function Memoize(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<any>) {
if (descriptor.value != null) {
memoizeMethod(descriptor);
@d4r5c0d3
d4r5c0d3 / Bootstrap.md
Last active October 20, 2015 11:48
JavaScript Snips

Bootstrap Snippet

load ajax content

// source  : http://stackoverflow.com/questions/18378720/bootstrap-3-with-remote-modal
// deprecated in Bootstrap 3.3 and will be removed in v4. Try this instead:

// Fill modal with content from link href
@d4r5c0d3
d4r5c0d3 / image-from-clipboard.js
Last active October 8, 2015 16:48
web-snippets
/*
* refercence
* http://joelb.me/blog/2011/code-snippet-accessing-clipboard-images-with-javascript/
*/
// We start by checking if the browser supports the
// Clipboard object. If not, we need to create a
// contenteditable element that catches all pasted data
if (!window.Clipboard) {
<?php
namespace ExampleBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
use ExampleBundle\Form\EventListener\addTranslatedFieldSubscriber;
@d4r5c0d3
d4r5c0d3 / my.cnf
Last active August 29, 2015 14:19
Configuration email-server ( Postfix, MySql, Dovecot)
# /etc/my.cnf
bind-address=127.0.0.1
@d4r5c0d3
d4r5c0d3 / AcmeAppExtension.php
Last active August 29, 2015 14:08
Custom Configuration Files in symfony
<?php
namespace Acme\AppBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
@d4r5c0d3
d4r5c0d3 / CheatSheets.md
Last active April 23, 2024 20:09
My CheatSheets
@d4r5c0d3
d4r5c0d3 / LoadQuestionData.php
Created March 28, 2014 13:40
How to use json with symfony datafixture bundle
<?php namespace Project\ServiceBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Project\ServiceBundle\Entity\Question;
/**
* Description of QuestionData
*