Skip to content

Instantly share code, notes, and snippets.

View freedmo's full-sized avatar
📚

Miku Grünwald freedmo

📚
View GitHub Profile
@xperseguers
xperseguers / MyCustomActionBackend.yaml
Last active May 19, 2020 15:41
Custom finisher for EXT:form in TYPO3 v8
# File EXT:your_ext/Configuration/Yaml/MyCustomActionBackend.yaml
TYPO3:
CMS:
Form:
prototypes:
# add our finisher to the 'standard' form prototype
standard:
formElementsDefinition:
Form:
formEditor:
@cmckni3
cmckni3 / get-event-listeners.js
Last active July 5, 2019 08:56
Get all event listeners on page
window.getAllEventListeners = () => {
return Array.from(document.querySelectorAll('*')).map(element => {
const listeners = getEventListeners(element);
return {
element: element,
listeners: Object.keys(listeners).map(key => {
return {
event: key,
@boekkooi
boekkooi / CustomPropertyAccessor.php
Last active December 23, 2020 02:49
Using a custom property path for symfony forms set / get path
<?php
use Symfony\Component\PropertyAccess\PropertyAccessor;
use Symfony\Component\PropertyAccess\PropertyPath;
/**
* A property accessor that allows you to rewrite a property path for setters and getters.
*/
class CustomPropertyAccessor extends PropertyAccessor
{
/**
@addyosmani
addyosmani / package.json
Last active May 29, 2024 15:54
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@omnidan
omnidan / PrettyJsonResponse.php
Last active July 17, 2019 12:48
Pretty-printed Symfony JsonResponse class. 100% compatible with the original class, requires PHP 5.4.0 or higher.
<?php
/**
* @license WTFPL (Do What the Fuck You Want to Public License)
* @author Daniel Bugl <daniel.bugl@touchlay.com>
*/
namespace TouchLay\HelperBundle\Component;
use Symfony\Component\HttpFoundation\JsonResponse;
@johnkary
johnkary / StudentChangeSubscriber.php
Created November 21, 2012 19:37
Doctrine listener for audit log functionality
<?php
namespace Acme\StudentBundle\Listener;
use Doctrine\Common\EventSubscriber,
Doctrine\ORM\Events,
Doctrine\ORM\Event\OnFlushEventArgs,
Doctrine\ORM\EntityManager,
DoctrineExtensions\Versionable\Entity\ResourceVersion;
@vsergeev
vsergeev / beagle_elfs.md
Created April 15, 2012 09:45
Minimalist "Embedded Linux from Scratch" Beaglebone Distribution Build

Busybox "Embedded Linux from Scratch" Distribution for the Beaglebone

Prepare your Build Sandbox

$ mkdir -p beaglelfs/{sources,rootfs_install,boot_mnt,rootfs_mnt}

Acquire an ARM Toolchain

Download the latest i686 Binary TAR of the ARM GNU/Linux (glibc-based) Lite Toolchain:

@pklaus
pklaus / enumerate_interfaces.py
Last active July 17, 2024 21:11
Python: List all Network Interfaces On Computer
"""
Determine IPv4 addresses on a Linux machine via the socket interface.
Thanks @bubthegreat the changes to make it Py2/3 compatible and the helpful
code comments: https://gist.github.com/pklaus/289646#gistcomment-2396272
This version has all comments removed for brevity.
"""
import socket
import array
import struct