Skip to content

Instantly share code, notes, and snippets.

<?php
declare(strict_types=1);
namespace App\Doctrine\EventListener;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Schema\PostgreSQLSchemaManager;
use Doctrine\DBAL\Schema\SchemaException;
use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs;
@anuraagdjain
anuraagdjain / CustomTableViewCell.swift
Created April 7, 2017 16:18
Custom Height for Delete (Swipe to Delete). Swift 3.X
override func layoutSubviews() {
super.layoutSubviews()
var subviews: [Any] = self.subviews
let subview = subviews[0] as! UIView
if subview.classForCoder.debugDescription() == "UITableViewCellDeleteConfirmationView" {
subview.frame.size.height = 50
subview.frame.origin.y = 10
subview.clipsToBounds = true
subview.layer.masksToBounds = true
}
@stefanfoulis
stefanfoulis / docker_for_mac_disk_default_size.md
Last active June 29, 2023 12:02
How to resize Docker for Mac Disk image and set the default size for new images

Set the default size for new Docker for Mac disk images

UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).

If you are getting the error: No space left on device

Configuring the qcow2 size cap is possible in the current versions:

# my disk is currently 64GiB
@pavelbinar
pavelbinar / extract-subtitles-from-mkv.md
Last active June 16, 2025 06:11 — forked from bmaeser/subtitle-extract.txt
Extract subtitles from .mkv files on Mac OS X
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR
@johnkary
johnkary / OracleDoctrineTypeMappingListener.php
Created September 8, 2013 03:45
Connecting to Oracle with Symfony2 and Doctrine 2. 1. Map Oracle's DATE type to Doctrine's "date" type instead of "datetime" for Oracle driver. 2. Properly configures Doctrine to use most common Oracle Date and DateTime environment configurations. You may or may not need this. Check your Oracle server configuration and see \Doctrine\DBAL\Event\L…
<?php
namespace Acme\PeopleSoftBundle\Listener;
use Doctrine\DBAL\Event\ConnectionEventArgs;
use Doctrine\DBAL\Events;
use Doctrine\Common\EventSubscriber;
/**
* Changes Doctrine's default Oracle-specific column type mapping to Doctrine
@doomhz
doomhz / opentok_multiple_sessions_final.html
Created August 20, 2012 10:12
OpenTok multiple sessions final implementation
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>OpenTok API Sample &#8212; Basic Tutorial</title>
<link href="samples.css" type="text/css" rel="stylesheet" >
<script src="http://staging.tokbox.com/v0.91/js/TB.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<script type="text/javascript" charset="utf-8">
@bowsersenior
bowsersenior / stooge_loader.rb
Created May 18, 2011 23:18
A demo of YAML anchors, references and nested values
require 'rubygems'
require 'yaml'
# A demonstration of YAML anchors, references and handling of nested values
# For more info, see:
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/
stooges = YAML::load( File.read('stooges.yml') )
# => {
# "default" => {