Skip to content

Instantly share code, notes, and snippets.

@loilo
loilo / ColumnParser.md
Last active June 9, 2018 01:57
Parses column-formatted UNIX output

PHP Column Parser

This PHP class takes a block of column-styled UNIX output (e. g. from composer show) and dissects it into lines and columns.

Take this excerpt from running the mentioned command in a Symfony project:

doctrine/cache               v1.7.1 Caching library offering an object-oriented API for many cache backends
doctrine/inflector           v1.2.0 Common String Manipulations with regard to casing and singular/plural rules.
illuminate/contracts         v5.5.2 The Illuminate Contracts package.
illuminate/support v5.5.2 The Illuminate Support package.
@manigandham
manigandham / rich-text-html-editors.md
Last active June 10, 2024 15:49
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@stof
stof / TwigRenderer.php
Last active September 16, 2020 07:46
Rendering twig blocks directly from outside a twig render call, for email purpose
<?php
namespace Incenteev\MailerBundle\Mailer;
class TwigRenderer implements RendererInterface
{
private $twig;
private $styleInliner;
/**
anonymous
anonymous / Email UI - Dribbble Rebound.markdown
Created June 11, 2015 19:08
Email UI - Dribbble Rebound

Email UI - Dribbble Rebound

Really wanted to try out some flexbox so I saw this design on dribbble and gave it a shot.

I didn't bother with any of the icons purely because of time.

Feedback is more then welcome. Also go give a like to the designer on dribbble.

http://dribbble.com/shots/1169541-Email-UI?list=users

@yoren
yoren / main.html
Last active September 16, 2015 18:05
Previous / Next Posts Links In AngularJS WordPress Theme
<!-- ... -->
<p>{{pageTitle}}</p>
<ul>
<li ng-repeat="post in posts">
<a href="blog/{{post.ID}}" ng-bind-html="post.title"></a>
<a href="blog/{{post.ID}}" ng-if="post.featured_image.attachment_meta.sizes.thumbnail.url"><img ng-src="{{post.featured_image.attachment_meta.sizes.thumbnail.url}}" alt="{{post.featured_image.title}}" /></a>
<div ng-bind-html="post.excerpt"></div>
</li>
</ul>
<posts-nav-link prev-label="&laquo; Previous Page" next-label="Next Page &raquo;"></posts-nav-link>
@jarrodirwin
jarrodirwin / storagePolyfill.js
Last active May 23, 2024 14:23 — forked from remy/gist:350433
LocalStorage/SessionStorage Polyfill with Safari Private Browsing support.
// Refer to https://gist.github.com/remy/350433
try {
// Test webstorage existence.
if (!window.localStorage || !window.sessionStorage) throw "exception";
// Test webstorage accessibility - Needed for Safari private browsing.
localStorage.setItem('storage_test', 1);
localStorage.removeItem('storage_test');
} catch(e) {
(function () {
var Storage = function (type) {
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public
@cferdinandi
cferdinandi / umd-script-boilerplate.js
Last active December 10, 2023 10:23
A simple boilerplate for UMD JS modules.
(function (root, factory) {
if ( typeof define === 'function' && define.amd ) {
define([], factory(root));
} else if ( typeof exports === 'object' ) {
module.exports = factory(root);
} else {
root.myPlugin = factory(root);
}
})(typeof global !== "undefined" ? global : this.window || this.global, function (root) {
@rjmoggach
rjmoggach / importSVGFilesAsLayers.js
Created May 30, 2014 07:07
Illustrator script to import a folder of SVG files into separate offset layers
// Import SVG Files as Layers - Illustrator CS3 script
// Description: Imports a folder of SVG files as named layers into a new document
// Author: Robert Moggach (rob@moggach.com)
// Version: 0.0.1 on 2014-05-29
function getFolder() {
return Folder.selectDialog('Please select the folder to be imported:', Folder('~'));
}
@ranacseruet
ranacseruet / VideoStream.php
Last active June 17, 2024 11:54
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";