Skip to content

Instantly share code, notes, and snippets.

View mch0lic's full-sized avatar

Mindaugas Budreika mch0lic

View GitHub Profile
@nagi1
nagi1 / bitbucket-pipeline.yaml
Created April 18, 2021 20:59
Example bitbucket-pipeline.yaml that works with laravel envoy. See https://ahmednagi.com/laravel-deploy-bitbucket
image: php:7.4-fpm
definitions:
steps:
- step: &composer-install
name: Build PHP
caches:
- composer
script:
- ls -al
@nagi1
nagi1 / Envoy.blade.php
Created April 18, 2021 20:55
Envoy script to achieve zero downtime deployment. see https://ahmednagi.com/laravel-deploy-bitbucket
@servers(['web' => $user.'@'.$host,'localhost' => '127.0.0.1'])
@setup
// Sanity checks
if (empty($host)) {
exit('ERROR: $host var empty or not defined');
}
if (empty($user)) {
exit('ERROR: $user var empty or not defined');
}
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active July 20, 2024 05:29
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@malkafly
malkafly / woocommerce-custom-shipping-method.php
Created February 20, 2018 18:10 — forked from alordiel/woocommerce-custom-shipping-method.php
Adding custom shipping method for WooCommerce (v. 3.2.6)
<?php
//Works with WooCommerce 3.2.6
add_action( 'woocommerce_shipping_init', 'econt_shipping_method' );
function econt_shipping_method() {
if ( ! class_exists( 'WC_Econt_Shipping_Method' ) ) {
class WC_Econt_Shipping_Method extends WC_Shipping_Method {
public function __construct( $instance_id = 0 ) {
$this->instance_id = absint( $instance_id );
$this->id = 'econt';//this is the id of our shipping method
@sveggiani
sveggiani / instructions.md
Last active July 15, 2023 21:52
[Configure XDebug, Visual Studio Code for a Vagrant VM] #debug #vm #vscode #masscode

Configure XDebug, Visual Studio Code for a Vagrant VM

1. Assumptions

  • Project (Drupal) is served on /var/www/html in the Vagrant box
  • Local project files location: c:\Users\username\Work\projects\my-project\repo\html
  • Guest machine IP is 10.0.2.2 (if this doesn't work, run route -nee in the VM and look for the gateway address)

2. Configuration

@gmanen
gmanen / .editorconfig
Created June 7, 2017 08:04
Editorconfig for Symfony projects
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = LF
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
@janneleppanen
janneleppanen / elasticpress-polylang.php
Last active June 4, 2020 20:48
ElasticPress - Polylang
// Filter Elasticsearch posts by current language
add_filter( 'ep_formatted_args', function($formatted_args, $args) {
$formatted_args['post_filter']['bool']['must'][] = [
'term' => [
'lang' => pll_current_language()
]
];
return $formatted_args;
}, 10, 2);
@Arinerron
Arinerron / permissions.txt
Last active June 23, 2024 19:34
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO
@eexit
eexit / Getting a Moto X back to stock on OSX Raw.md
Last active November 28, 2020 17:37
Getting a Moto X back to stock on OSX

Getting a Moto X back to stock on OSX

Backup, first!

  1. Downloads the Android SDK Command Line Tools

     $ unzip android-sdk-macosx.zip
     $ cd android-sdk-macosx
    
  2. Create a backup folder

@wpexplorer
wpexplorer / gist:7b865df164c4c7d0bed2
Created November 23, 2015 18:58
Custom WordPress Walker
<?php
/**
* /!\ This is a copy of Walker_Nav_Menu_Edit class in core
*
* Create HTML list of nav menu input items.
*
* @package WordPress
* @since 3.0.0
* @uses Walker_Nav_Menu
*/