Skip to content

Instantly share code, notes, and snippets.

View alister's full-sized avatar
🏠
Working from home

Alister Bulman alister

🏠
Working from home
View GitHub Profile
@frankdejonge
frankdejonge / README.md
Last active June 12, 2022 22:07
PHP Wither template

You can copy the XML below and paste them into your live templates in PHPStorm to start using it :)

@alister
alister / ComicSansMSEverywhere.Bookmarklet.js
Last active March 13, 2020 12:32
Everything's more fun in these difficult times with Comic Sans....
javascript: var all = document.getElementsByTagName('*'); for (var i = 0, n = all.length; i < n; i++) { all[i].style.fontFamily = '"Comic Sans MS", "Chalkboard"';} void 0;
@ErickPetru
ErickPetru / worktree-publish-to-gh-pages.md
Created September 13, 2019 13:26
Publishing a `dist` folder from `master` branch using **worktree** feature to `gh-pages` branch.

Setup

First of all, you need to have a gh-pages. If you don't have, create:

git branch gh-pages

This makes a branch based on the master HEAD. It would be okay but the files and the git history of master branch are not meaningful on gh-pages branch.

@jaircuevajunior
jaircuevajunior / mysql_debian_user.md
Last active October 21, 2024 18:42
Fix logrotate error regarding mysql on Ubuntu

Fix logrotate error regarding mysql on Ubuntu

Sometimes if you are mailed of cronjobs, will may got an error like this:

/etc/cron.daily/logrotate:
error: error running shared postrotate script for '/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

Well, don't panic! Also don't ignore it! :)

@weaverryan
weaverryan / FooController.php
Last active April 18, 2017 13:58
Autowiring controller args
<?php
namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Psr\Log\LoggerInterface;
/**
* This class is now a service, so you can use normal __construct DI if you want!
*/
@PurpleBooth
PurpleBooth / composer.phar
Last active February 13, 2017 23:14
I am on a system with docker but without PHP
#!/bin/bash
set -euo pipefail
if [ ! -d "$HOME/.composer" ]; then
mkdir "$HOME/.composer"
touch "$HOME/.composer/.lastpull"
fi
if test find "$HOME/.composer/" -name ".lastpull" -and -mtime +7 > /dev/null 2>&1 ; then
@rwitchell
rwitchell / FacebookConnectController.php
Created May 23, 2016 14:28
oauth2-client-bundle install example
<?php
namespace Comp\AppBundle\Controller;
use Comp\AppBundle\Entity\User;
use Comp\AppBundle\Form\FacebookRegistrationType;
use League\OAuth2\Client\Provider\FacebookUser;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
@jamescun
jamescun / letter.md
Created November 4, 2015 22:48
Letter to Emily Thornberry regarding the Draft Investigatory Powers Bill

Dear Emily Thornberry,

I write to you with a simple hypothetical. Imagine the ISP TalkTalk were required by law to retain 12 months worth of internet access history, now imagine the result of their recent security breach given this. Every TalkTalk customer would potentially have their entire private online world exposed to the public: from the popular teenager, terrified of the views of his family and friends, researching LGBTQ issues; to the jovial receptionist frequenting suicide support forums. None of it legally sensitive, but personally devastating.

TalkTalk are not alone: BT, Virgin and Sky have all had data breaches go public. As long as data security continues to be overlooked at these companies and many others, data breaches will continue to happen. The only way to safe guard the above information from attack, is to not have it at all.

If the proposed Draft Investigatory Powers Bill were to pass, the above would become an all too common reality. Nobody argues against the need for our security serv

@patio11
patio11 / ansible-snippet.yaml
Created July 9, 2015 02:44
Create an account on every box using the list of employees; initialize with their Github SSH keys
vars:
starfighters:
- username: patrick
github: patio11
name: "Patrick McKenzie"
- username: thomas
github: tqbf
name: "Thomas Ptacek"
- username: erin
github: boboTjones
@mickaelandrieu
mickaelandrieu / upgrade2.3-to-2.7.md
Last active May 21, 2024 03:39
Complete migration guide from Symfony 2.3 LTS to Symfony 2.7 LTS

From Symfony 2.3 to Symfony 2.7: the complete guide

Objectives

  • assume your code doesn't use any deprecated from versions below Symfony 2.3
  • update dependencies from 2.3 to 2.7
  • do not support "deprecated", be "Symfony3-ready"
  • list tasks component by component, bundle by bundle.