Skip to content

Instantly share code, notes, and snippets.

View neonxp's full-sized avatar
🤖
Code to live, live to code

Alex neonxp

🤖
Code to live, live to code
  • Kazan, Russian Federation
View GitHub Profile
@neonxp
neonxp / FormErrorsSerializer.php
Last active September 28, 2017 10:12 — forked from Graceas/FormErrorsSerializer.php
Symfony 2 Form Error Serializer. May be used for AJAX form validation. Allows tree and flat array styles for errors.
class FormErrorsSerializer {
public function serializeFormErrors(\Symfony\Component\Form\Form $form, $flat_array = false, $add_form_name = false, $glue_keys = '_')
{
$errors = array();
$errors['global'] = array();
$errors['fields'] = array();
foreach ($form->getErrors() as $error) {
$errors['global'][] = $error->getMessage();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.button {
background-color: #eaeaea;
border: 1px solid #e7e7e7;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.button {
display: inline-block;
background-color: #286aa8;
@neonxp
neonxp / PHPtoICS.php
Last active August 29, 2015 14:22 — forked from jakebellacera/ICS.php
<?php
// Variables used in this script:
// $summary - text title of the event
// $datestart - the starting date (in seconds since unix epoch)
// $dateend - the ending date (in seconds since unix epoch)
// $address - the event's address
// $uri - the URL of the event (add http://)
// $description - text description of the event
// $filename - the name of this file for saving (e.g. my-event-name.ics)
//
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶