Skip to content

Instantly share code, notes, and snippets.

@h0bbel
h0bbel / sources.list
Last active April 16, 2025 19:19
/etc/apt/sources.list for Ubuntu 18.04.1 LTS Bionic Beaver
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
@djaiss
djaiss / progress_bar_migration_laravel.php
Last active February 5, 2025 13:59
Laravel: Use progress bars in migrations
<?php
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\ConsoleOutput;
class DoSomething extends Migration
{
public function up()
{
$output = new ConsoleOutput();
@damiencarbery
damiencarbery / change-caps-to-allow-order-views.php
Last active January 9, 2018 17:00
Allow Viewing of Other Customer Orders in WooCommerce
<?php
add_filter( 'user_has_cap', 'cci_check_view_order_capability', 10, 3 );
function cci_check_view_order_capability( $allcaps, $caps, $args ) {
if ( isset( $caps[0] ) ) {
switch ( $caps[0] ) {
case 'view_order' :
// Check that the current user billing_company and order billing company match.
$current_user = wp_get_current_user();
$current_user_billing_company = get_user_meta( $current_user->ID, 'billing_company', true );
$order = wc_get_order( $args[2] );
@shime
shime / _readme.md
Last active November 11, 2024 01:23 — forked from ryin/tmux_local_install.sh
installation script for tmux 1.9a

Having trouble installing the latest stable version of tmux?

I know, official package for your OS/distro is outdated and you just want the newest version of tmux.

Well, this script should save you some time with that.

Prerequisities

  • gcc