Skip to content

Instantly share code, notes, and snippets.

@diogomoretti
diogomoretti / fonts.styl
Last active November 20, 2019 06:37
Stylus mixin @font-face
// Fonts mixin
font-url(file)
return '../fonts/' + file
webfont(family, file, hack-chrome-windows = false, weight = 'normal')
@font-face
font-family family
src url(font-url(file + '.eot'))
src url(font-url(file + '.eot?#iefix')) format('embedded-opentype'),
url(font-url(file + '.woff')) format('woff'),
@pixelbrackets
pixelbrackets / TYPO3update.txt
Last active July 4, 2017 13:15
TYPO3 Update via wget
wget get.typo3.org/4.5 -O typo3_src-4.5.40.tar.gz && tar xzf typo3_src-4.5.40.tar.gz && ln -snf typo3_src-4.5.40 typo3_src-4.5
wget get.typo3.org/6.2 -O typo3_src-6.2.27.tar.gz && tar xzf typo3_src-6.2.27.tar.gz && ln -snf typo3_src-6.2.27 typo3_src-6.2
wget get.typo3.org/7 -O typo3_src-7.6.11.tar.gz && tar xzf typo3_src-7.6.11.tar.gz && ln -snf typo3_src-7.6.11 typo3_src-7
wget get.typo3.org/8 -O typo3_src-8.3.1.tar.gz && tar xzf typo3_src-8.3.1.tar.gz && ln -snf typo3_src-8.3.1 typo3_src-8
@NamelessCoder
NamelessCoder / MyModel.php
Last active November 25, 2015 14:02
Example of using annotations to generate TCA configuration based on a Model class.
<?php
namespace FluidTYPO3\Demo\Domain\Model;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
/**
* Domain Model: Simple entry with tag relations.
*
* The annotations on the class-level doc comment define
@leftclickben
leftclickben / gist:322b7a3042cbe97ed2af
Last active June 7, 2023 10:58
Steps to migrate from SVN to GitLab

Steps to migrate from SVN to GitLab

This process worked for me. I take no responsibility for any damage or loss incurred as a result of following or not following these steps or, for that matter, anything else you might do or not do.

Setup

  • SVN is hosted at svn.domain.com.au.
  • SVN is accessible via http (other protocols should work).
  • GitLab is hosted at git.domain.com.au and:

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@dialupdev
dialupdev / Setting up headless Raspberry Pi OS on macOS.md
Last active May 2, 2024 02:21
Setting up headless Raspberry Pi OS on macOS

Download the latest Raspberry Pi OS Lite image from https://www.raspberrypi.com/software/operating-systems/ (2022-04-04 at the time of this writing).

Insert your microSD card. Use Raspberry Pi Imager to burn the image to your microSD card. Make to select "Set username and password" in the config before starting. Name the user pi and select your own password.

Ensure the disk is mounted again, then enable SSH.

$ touch /Volumes/boot/ssh
@pixelbrackets
pixelbrackets / homepage.html
Last active August 29, 2015 14:13
Allow/Deny Content Elements in FLUX grids
<!-- Allow ONLY the FCE »Slider« in a column -->
<flux:grid>
<flux:grid.row>
<flux:grid.column name="sliderContent" colPos="1" variables="{allowedContentTypes: 'fluidcontent_content', Fluidcontent: {allowedContentTypes: 'Vendorname.some_extension_key:Slider.html'}}" />
</flux:grid.row>
<flux:grid.row>
<flux:grid.column name="mainContent" colPos="0" variables="{Fluidcontent: {deniedContentTypes: 'Vendorname.some_extension_key:Slider.html'}}" />
</flux:grid.row>
</flux:grid>
@jmverges
jmverges / gist:ee575de1f8db246fe107
Created March 14, 2015 13:08
allowedContentTypes
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
xmlns:flux="http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers">
<f:layout name="Content" />
<f:section name="Configuration">
<flux:form id="container">
<flux:form.option name="group" value="Layout" />
@lmakarov
lmakarov / install-docker-compose.sh
Created June 30, 2015 16:47
Install docker-compose in boot2docker 1.7.0+
#!/bin.sh
DOCKER_COMPOSE_VERSION=1.3.0
# Download docker-compose to the permanent storage
echo 'Downloading docker-compose to the permanent VM storage...'
sudo mkdir -p /var/lib/boot2docker/bin
sudo curl -sL https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /var/lib/boot2docker/bin/docker-compose
sudo chmod +x /var/lib/boot2docker/bin/docker-compose
sudo ln -sf /var/lib/boot2docker/bin/docker-compose /usr/local/bin/docker-compose
@DarrenN
DarrenN / get-npm-package-version
Last active May 2, 2025 08:59 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION