Skip to content

Instantly share code, notes, and snippets.

@tortuetorche
tortuetorche / Select2.php
Created December 10, 2020 09:35
Select2 v4.0+ helpers for the WebDriver module of Codeception 4.1 (and certainly older versions)
<?php // @codingStandardsIgnoreFile
namespace Helper;
use Exception;
// Select2 helpers for Codeception
// See: https://select2.org
//
// Works with Select2 version 4.0 or greater
// Which is a jQuery based replacement for select boxes.
@danharper
danharper / CatchAllOptionsRequestsProvider.php
Last active April 20, 2024 01:53
Lumen with CORS and OPTIONS requests
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
/**
* If the incoming request is an OPTIONS request
* we will register a handler for the requested route
*/
class CatchAllOptionsRequestsProvider extends ServiceProvider {
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@sandcastle
sandcastle / install-teamcity.md
Last active December 7, 2023 18:02
Install TeamCity 9.0.3 on Ubuntu with Nginx
@JeffreyWay
JeffreyWay / laravel.js
Last active April 6, 2024 20:12
Want to send a DELETE request when outside of a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. (Requires jQuery, but doesn't have to.) To use, import script, and create a link with the `data-method="DELETE"` attribute.
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {