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 Problematic\UserBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Problematic\UserBundle\Entity\User; | |
class RegistrationController extends Controller | |
{ |
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
class FormType extends AbstractType | |
{ | |
// .... | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$builder->add('field') | |
->add(....) | |
->addEventListener(FormEvents::POST_BIND, array($this, 'postBind')); | |
} |
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
<form id="loginForm" method="post" action="${request.route_url('login')}"> | |
<input type="hidden" name="csrf_token" value="${request.session.get_csrf_token()}"/> | |
<fieldset class="concise"> | |
<metal:field tal:define="name 'came_from'" use-macro="snippets['hidden']"/> | |
<metal:field tal:define="name 'login'" use-macro="snippets['text']"/> | |
<metal:field tal:define="name 'password'" use-macro="snippets['password']"/> | |
</fieldset> | |
<div class="buttonBar"> | |
<button type="submit" class="default" i18n:translate="">Login</button> | |
</div> |
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
curl http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc | sudo apt-key add - | |
sudo vi /etc/apt/sources.list | |
cat /etc/apt/sources.list | |
deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi | |
deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/ wheezy main | |
sudo apt-get update | |
sudo apt-get install uv4l-webrtc | |
sudo apt-get install uv4l-raspicam-extras | |
sudo service uv4l_raspicam restart |
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
(ns create-draw.opencv | |
(:import | |
org.opencv.core.Core | |
org.opencv.core.Mat | |
org.opencv.core.MatOfRect | |
org.opencv.core.Point | |
org.opencv.core.Rect | |
org.opencv.core.Scalar | |
org.opencv.highgui.Highgui | |
org.opencv.objdetect.CascadeClassifier)) |
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
(ns braintree-clj.core | |
(:import [com.braintreegateway BraintreeGateway Environment TransactionRequest Transaction$Type]) | |
(:require [clojure.string :as s] | |
[hiccup.core :as hiccup] | |
[hiccup.page-helpers :as page-helper] | |
[noir.core :as noir] | |
[noir.request :as noir-req] |
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
{-# LANGUAGE ExistentialQuantification #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
module Fix where | |
-- Definitions: | |
-- | |
-- If (μF,inF) is the initial F-algebra for some endofunctor F |
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 | |
// Snippet for Symfony 2 application that uses Doctrine 2 to handle transactions | |
// It uses the names of the objects/doctrine repositories from the Beta 4 Manual of Symfony 2. | |
// Get the entity manager | |
$em = $this->getDoctrine()->getEntityManager(); | |
// suspend auto-commit | |
$em->getConnection()->beginTransaction(); |
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 | |
# chmod +x setup.sh && ./setup.sh | |
# [!] only for testing! this is not stable or secure | |
# it takes some hours. | |
# it is available under http://<server-ip>:8080 | |
# | |
# make sure that you run ubuntu 16.04 | |
# you need minimum 25gb (10gb filled with build dependencies) |
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
-- base ==4.7.0.1 | |
-- bytestring ==0.10.4.0 | |
-- connection ==0.2.4 | |
-- network ==2.4.2.3 | |
-- text ==1.1.0.0 | |
-- websockets ==0.9.3.1 | |
import Control.Concurrent (forkIO) | |
import Control.Monad (forever, void) | |
import qualified Data.ByteString as BS |
OlderNewer