Skip to content

Instantly share code, notes, and snippets.

@smichaelsen
smichaelsen / fluid_inline_viewhelper.md
Created November 13, 2014 09:54
TYPO3 Fluid inline viewhelper in array

I regularly fail to remember the correct syntax to do this. So here it is:

<f:form.select
 property="gender"
 id="user_gender"
 options="{1: '{f:translate(key: \'orderform.customer_data.gender.w\')}', 2: '{f:translate(key: \'orderform.customer_data.gender.m\')}'}

"/>

<?php
namespace Smichaelsen\Gist\Mail;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext;
/**
* This class represents an email which can be rendered with fluid.
* You can use all the possibilities of TYPO3's MailMessage but instead of
@StephenKing
StephenKing / Vagrantfile
Last active December 17, 2015 09:19
My Vagrantfile
boxes = [
{
:name => :default,
:ip => '192.168.156.130',
:run_list => '',
# :http_port => '8080',
# :gui => true,
# :memory => 2048,
# :cpus => 4,
},
@tracker1
tracker1 / .eslintrc
Created March 24, 2015 00:43
ES6 Testing With Mocha and BabelJS
{
"ecmaFeatures": {
"arrowFunctions": true,
"binaryLiterals": false,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": true,
@softwaredoug
softwaredoug / dummySolr.sh
Last active September 18, 2016 18:18
Shell script for creating sandbox solr collections for playing/experimentation
#!/bin/sh
# Silly shell script for creating test/sandbox solr collections for
# quick experimentation
#
# Setup
# 1. git clone <lucene-solr repo>
# 2. Place this script in the git root directory
# 3. Change DUMMY_SOLR_HOME below where you want to create toy collections
@natefinch
natefinch / .travis.yml
Created February 22, 2017 03:58
Minimal .travis.yml for go projects that use glide with private repos
language: go
go:
- 1.8
before_install:
- git config --global url."git@github.com:".insteadOf "https://github.com/"
- wget "https://github.com/Masterminds/glide/releases/download/v0.12.3/glide-v0.12.3-linux-amd64.tar.gz"
- mkdir -p $HOME/bin
- tar -vxz -C $HOME/bin --strip=1 -f glide-v0.12.3-linux-amd64.tar.gz
/**
* Simple userland heapdump generator using v8-profiler
* Usage: require('[path_to]/HeapDump').init('datadir')
*
* @module HeapDump
* @type {exports}
*/
var fs = require('fs');
var profiler = require('v8-profiler');
@nrrrdcore
nrrrdcore / apple-shadow.css
Created May 17, 2012 17:19
Bending Shadows Backwards: Apple.com's Container CSS Sorcery
.shadow-stuff {
-moz-border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px;
-webkit-border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px;
border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px;
-moz-box-shadow: rgba(0,0,0,.30) 0 2px 3px;
-webkit-box-shadow: rgba(0,0,0,.30) 0 2px 3px;
box-shadow: rgba(0,0,0,.30) 0 2px 3px;
}
.container {
@kandran
kandran / README.md
Last active November 19, 2018 08:28
Use php-cs-fixer with phpstorm file watcher

Auto use php-cs-fixer at save with PHPStorm and file watcher

  1. Open settings ( ctrl + alt + s)
  2. Menu file watchers
  3. Import watchers.xml
  4. Change settings like path for php and php-cs-fixer
  5. Enjoy ! PSRize at save.

NB: File watchers are linked to a specific project, so we have to re-import them for each project. External tools have IDE scope but we couldn't run them automaticaly - we could set a key bind.

#!/bin/bash
usage ()
{
cat <<UsageHERE
boot2docker-fwd -- Helper function to quickly manage port forwards between the boot2docker-vm and the host
Usage: boot2docker-fwd [ -n RULE_NAME ] [ -h HOST_PORT ] [ -p {tcp|udp} ] [ -i HOST_IP ] GUEST_PORT
or boot2docker-fwd -d RULE_NAME
or boot2docker-fwd -l
or boot2docker-fwd -A