Skip to content

Instantly share code, notes, and snippets.

View jensscherbl's full-sized avatar

Jens Scherbl jensscherbl

  • Munich, Germany
  • 01:39 (UTC +02:00)
View GitHub Profile
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@brad-jones
brad-jones / scgi-server.php
Created January 23, 2014 06:24
The SCGI protocol is a replacement for the Common Gateway Interface (CGI) protocol. It is a standard for applications to interface with HTTP servers. It is similar to FastCGI but is designed to be easier to implement. This is a PHP Implementation.
<?php
/**
* Class: MyListener
* =============================================================================
* This sets up the underlying socket server.
* Using all this nice new LibEvent code which is now part of PHP.
*/
class MyListener
{

Providers: An Introduction

Providers is a concept that was introduced with Symphony 2.3 which allows extensions to natively provide new Data Source types. This allowed for a more seamless experience for users and opened up a world of possibilities for extension developers. The upcoming Symphony 2.3.1 release brings Providers to Events as well, allowing developers to provide new event types selectable from the native Event editor.

For Users

For users, the benefits are more flexible and powerful DataSources and Events that can start to do things that previously required custom code. Extensions such as Cacheable DataSource, Union DataSource and Remote DataSource all bring powerful functionality to the fingertips of every Symphony ninja (and those in training). The addition of Events means that we can now create extensions that abstract common API's (such as Github) to read and write information without any knowledge of the underlying API.

For Developers

@brendo
brendo / backend.html
Created April 13, 2012 15:14
Symphony Backend markup
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- Core styles -->
<link rel="stylesheet" type="text/css" media="screen" href="http://example.com/symphony/assets/css/symphony.css">
<link rel="stylesheet" type="text/css" media="screen" href="http://example.com/symphony/assets/css/symphony.legacy.css">
<link rel="stylesheet" type="text/css" media="screen" href="http://example.com/symphony/assets/css/symphony.grids.css">
@brendo
brendo / prepareImportValue.md
Created April 11, 2012 14:03
Introducing the XML Importer's prepareImportValue function

Introducing the XML Importer's prepareImportValue function

The XML Importer extension is widely used to help users import XML content into their Symphony sections. Developers enter a URL that returns XML and then write XPath to map values to their corresponding fields, but sometimes this results in a field not receiving a value, an incorrect value, or the XML Importer failing to import anything.

While not always the case, sometimes the XPath could be wrong, namespaces weren't added or you've discovered a bug (log it, but it can also be because a Field doesn't know how take the value you've given it and save it. This short article will explain how you can ensure that your field is compatible with the XML Importer, thanks to the prepareImportValue function.

Why is it needed?

Fields in Symphony have two existing function's, checkPostFieldData and [processRawFieldData]

@brendo
brendo / script_texthtml.md
Created February 18, 2012 04:11
Using <script type='text/html'>

Using <script type='text/html'>

While looking for a more manageable way to maintain my Mustache templates, I came across the icanhaz, which promotes putting your templates in your DOM using:

<script type='text/html' id='your-template>
    // Template in here
</script>

Being a bit of a performance nut, I was nervous about putting my templates into the DOM like this for a couple of reasons:

@saetia
saetia / gist:1623487
Last active May 1, 2024 19:55
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@brendo
brendo / EventTutorial.md
Created May 23, 2011 09:40 — forked from nickdunn/EventTutorial.md
Symphony Events: A Detailed Look

Forms have been an integral part of any interactive site since the dawn of time — they promote interactivity and are usually the most common way users interact with a site. It's commonplace that when a form is submitted (input), the website will take 'action' and do something with the data (processing) and then provide a user with the result (output). Symphony provides this logic layer via events.

This tutorial is about customising Symphony events. You will learn about:

  • event execution conditions (load and __trigger)
  • field naming and the $_POST array
  • creating related entries in two or more sections at the same time, aka. event chaining
  • event priority (execution order)
  • entirely custom events
@brendo
brendo / symphonydelgates.md
Created May 10, 2011 10:52
DelegateExecutionOrder

Requesting {$root}/page-one/

  • FrontendInitialised
  • FrontendPrePageResolve
  • FrontendPageResolved
  • FrontendParamsResolve
  • FrontendProcessEvents
  • EventPreSaveFilter (for each Event executed)
  • EventPostSaveFilter (for each Event executed)
  • EventFinalSaveFilter (for each Event executed)
@brendo
brendo / EventTutorial.md
Created April 4, 2011 11:06
Symphony Events: A Detailed Look

Forms have been an integral part of any interactive site since the dawn of time, they promote interactivity and are usually the most common way users interact with a site. It's commonplace that when a form is submitted, the website will take 'action' and do something with the data and then provide a user with the result. Symphony provides this logic layer via Events.

This tutorial assumes you have a basic understanding of how Events work in Symphony (if not, this may be a good introduction) and are semi comfortable writing some PHP code. I'll be showing you some of the lesser known features of Symphony Events, including event priority, event chaining and a brief demonstration of how to write a custom Event. The difficulty level progresses as we go through, but with any luck you'll be able to learn a thing or two :)

Getting Started

The Scenario

Our client requires a form that allows a user to submit some details about their new car purchase. Th