Skip to content

Instantly share code, notes, and snippets.

View crmpicco's full-sized avatar
🏴󠁧󠁢󠁳󠁣󠁴󠁿
Blahem

Craig R Morton crmpicco

🏴󠁧󠁢󠁳󠁣󠁴󠁿
Blahem
View GitHub Profile
@florentdestremau
florentdestremau / NewPasswordType.php
Last active March 10, 2023 13:17
A simple User authentication setup to copy & paste into your Symfony 3.4 install
<?php
namespace AppBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
@landsman
landsman / draft.js
Last active December 6, 2022 18:06
automatic convert bootstrap v. 3 to bootstrap v. 4 idea ... more on https://github.com/twbs/bootstrap/blob/v4-dev/docs/4.0/migration.md, http://upgrade-bootstrap.bootply.com/
let gulp = require('gulp'),
replace = require('gulp-batch-replace'),
filesExist = require('files-exist');
gulp.task('bt4', () =>
{
let diff = {
'@media (min-width: $screen-xs-min) and (max-width: $screen-sm-max)': '@media (min-width: map-get($grid-breakpoints, xs)) and (max-width: map-get($grid-breakpoints, xs))',
'@media (min-width: $screen-xs) and (max-width: ($screen-md-min - 1))': '@media (min-width: map-get($grid-breakpoints, xs)) and (max-width: map-get($grid-breakpoints, md)-1)',
@coolaj86
coolaj86 / install-libdvdcss-macos.md
Last active April 27, 2022 16:34
Installing libdvdcss on macOS Sierra

libdvdcss.pkg will no longer install on OS X (now macOS).

Here's how to build and install libdvdcss.2.dylib so that you can use it with, for example, VLC and/or Handbrake.

The old way

wget https://download.videolan.org/libdvdcss/1.2.11/macosx/libdvdcss.2.dylib
@DragonBe
DragonBe / php_apache_homebrew.md
Last active November 20, 2022 18:15
Installation of Apache 2.4 and PHP 7.1 with Homebrew

I posted several talks about compiling PHP from source, but everyone was trying to convince me that a package manager like Homebrew was a more convenient way to install.

The purpose of Homebrew is simple: a package manager for macOS that will allow you to set up and install common packages easily and allows you to update frequently using simple commands.

I used a clean installation of macOS Sierra to ensure all steps could be recorded and tested. In most cases you already have done work on your Mac, so chances are you can skip a few steps in this tutorial.

Apache and PHP with homebrew

I’ve made this according to the installation instructions given on GetGrav.

@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active April 11, 2024 22:29
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@elenakondrateva
elenakondrateva / ImportFromCSVCommand.php
Last active June 27, 2017 02:45
Symfony Command Import from CSV abstract class
<?php
namespace Acme\CoreBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@vidaaudrey
vidaaudrey / ie67891011-css-hacks.txt
Created June 19, 2016 20:52 — forked from ricardozea/ie67891011-css-hacks.txt
IE CSS hacks - IE6, 7, 8, 9, 10, 11
IE6 Only
==================
_selector {...}
IE6 & IE7
==================
*html or { _property: }
IE7 Only
==================
@mickaelandrieu
mickaelandrieu / upgrade_to_symfony3-lts.md
Last active March 20, 2024 20:16
Migration guide to Symfony 3 LTS

Let's migrate a Symfony 2.8 LTS application to Symfony 3 LTS

Handle deprecations

First of all, ensure you don't have any deprecated!

The Symfony documentation explains it well, but let's sum up:

  • install the phpunit bridge ($ composer require --dev symfony/phpunit-bridge)
  • also check all your pages using web profiler and be ensure there is no deprecation error handled
  • found errors and need help about how to fix it ? I did a sort of guide.
@damusix
damusix / aws_iam_secret_to_smtp_password.md
Last active April 16, 2024 08:39
Convert AWS IAM credentials to AWS SMTP credentials

Convert AWS IAM credentials to AWS SMTP credentials

If you do, or want to, use AWS to deploy your apps, you will end up using AWS SES via SMTP when you're launching an app that sends out emails of any kind (user registrations, email notifications, etc). For example, I have used this configuration on various Ruby on Rails apps, however, it is just basic SMTP configurations and crosses over to any framework that supports SMTP sendmail.

There are two ways to go about this:

Luckily, you found this MD file and the NOT SO EASY WAY is suddenly copy-pasta... sudo yum....

@nepsilon
nepsilon / how-to-git-patch-diff.md
Last active April 19, 2024 13:33
How to generate and apply patches with git? — First published in fullweb.io issue #33

How to generate and apply patches with git?

It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what diff outputs to your local working copy.

You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:

1. Generate the patch:

git diff &gt; some-changes.patch