Skip to content

Instantly share code, notes, and snippets.

View miraclebg's full-sized avatar
⛰️
Wishing for a hike :)

Martin Kovachev miraclebg

⛰️
Wishing for a hike :)
View GitHub Profile
@scyto
scyto / glsuterfs-volume-plugin.md
Last active September 27, 2023 07:29
installing a glusterfs volume plugin

Description

I wanted a simpler way to assign gluster volumes in new stacks without having to create directories by hand There are variety of community plugins for this.

I chose to use this one https://github.com/chrisbecke/glusterfs-volume It creates a directory called <stackname>_<volumename> for each volume defined in the stack.

Pre-reqs

Assume you setup glusterfs per this gist here

@theodorejb
theodorejb / convert_array_access_braces.php
Last active March 27, 2024 18:22
Migrate deprecated curly brace array access syntax to bracket syntax. Requires PHP 7.4.
<?php
error_reporting(E_ALL);
$opts = getopt('f:d:rb:', ['ext:', 'php:', 'diff::']);
if ((int)isset($opts['d']) + (int)isset($opts['f']) !== 1) {
$self = basename(__FILE__);
echo <<<EOF
Usage:
php $self -f<php_script> [-b] [--php <path_to_php>] [ --diff [<file>]]
@Lax
Lax / com.example.jenkins.plist
Created December 14, 2017 16:54
Start jenkins slave agent on macOS. launchctl load -w com.example.jenkins.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.example.ci</string>
<key>UserName</key>
<string>lax</string>
<key>ProgramArguments</key>
<array>
@hoandang
hoandang / php-docker-ext
Created May 20, 2017 01:12
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@markph0204
markph0204 / gist:da62dfe78cfae01077192b61392f0431
Created May 11, 2017 22:49
Remove development paths from Spotlight
touch ~/Library/Caches/.metadata_never_index
touch ~/Library/Developer/.metadata_never_index
killall Finder
@loziju
loziju / macosx-configure-postfix-as-relay.md
Last active July 11, 2024 00:06
Configure postfix as relay for OS X
@pixeline
pixeline / php_upgrade_to_71.sh
Last active March 16, 2023 16:49
Update Mac Os X's php version to php 7.1 using homebrew. Includes curl and mcrypt
# 1. Install brew --> http://brew.sh/
# 2. run the following commands in your Terminal
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install --with-openssl curl
brew install --with-homebrew-curl --with-apache php71
brew install php71-mcrypt php71-imagick
# 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot.
brew info php71
@icanswiftabit
icanswiftabit / bundlerInIOS.MD
Last active April 6, 2024 14:54
How to use bundler with iOS projects

#How to use Bundler with iOS projects

You probably stuck with situation when after finishing for example bundle install && bundle exec pod install Bundler couldn't access gems which he just download. Some of you may think "RVM is the answer!" and yes it is, but what if it is not?

##Don't use macOS's gems. Just DON'T.

  1. Establish that you will don't use macOS's gems and RVM.
  2. Go to your_app_dir
  3. Make sure you have Gemfile if not create one
@zafarella
zafarella / intellij VM Options
Created November 14, 2016 04:18
IntelliJ IDEA 2016.2.5 VM options for better response time. (OSX 16GB) -> Help -> Edit custom VM options
-Xms128m
-Xmx1g
-XX:ReservedCodeCacheSize=240m
-XX:+UseCompressedOops
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:ConcGCThreads=4
-XX:+AlwaysPreTouch
-XX:+TieredCompilation
-XX:+UseCompressedOops
@bjornson
bjornson / PositionedCropTransformation.java
Last active October 16, 2023 15:42
Custom Glide CropTransformation that allows top/center/bottom left/center/right crop with percentages
package com.extendedvision.futurehistory.images;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;