Skip to content

Instantly share code, notes, and snippets.

View Djuki's full-sized avatar

Ivan Đurđevac Djuki

  • Freelancer
  • Serbia
  • 19:06 (UTC -12:00)
  • X @Djuki
View GitHub Profile
@Djuki
Djuki / 0_reuse_code.js
Created July 7, 2014 09:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Djuki
Djuki / redis_install.sh
Last active November 16, 2015 16:17
Install redis as a service shell script
VER=3.0.5
sudo apt-get update
# Install the required tools to build the source
sudo apt-get install build-essential
# Download and extract the files
wget http://download.redis.io/releases/redis-$VER.tar.gz
tar -xzf redis-$VER.tar.gz
cd redis-$VER
# Compile
@Djuki
Djuki / deploy.sh
Last active August 29, 2015 14:04
Deploy script for Laravel apps
# stop script on error signal
set -e
# delete deployment folder if script exit before end last time
if [ -d "/home/forge/deployment" ]; then
rm -R /home/forge/deployment
fi
# set up your env variables if your app using them
export DB_HOST=localhost
@Djuki
Djuki / LaravelHelper.php
Created December 9, 2014 10:29
Codeception helper for Laravel3 integration
<?php
namespace Codeception\Module;
use Codeception\Util\Framework;
use Codeception\TestCase;
use Codeception\Util\Connector\Universal;
use Codeception\Configuration;
use Symfony\Component\BrowserKit\Response;
use Laravel\Routing\Router;
@Djuki
Djuki / survey_users_api.md
Created July 20, 2015 15:43
Survey API documentation

User API

Create a new user

API point

https://surveyfunnel.io/api/v1/payplan/register

Method:

post

@Djuki
Djuki / php_mentoring_001.markdown
Last active September 8, 2015 15:19
PHP Mentoring Tasks

Resizing library

This task is created for apprentices who want to learn about OOP

Create PHP library which will resize the images.

For cropping images we will use library "image-workshop" - https://packagist.org/packages/sybio/image-workshop

Library need to support several types of resizing

  • Exact: Resize to exact width and height. Aspect ratio will not be maintained
@Djuki
Djuki / company_packages_develepment.md
Created October 22, 2015 10:18
Guide How to develop company packages

Packages development Guide

Intro

Our company has private packages which are shared between projects. We use composer to install our private packages.

Our static composer repository is located on this URL:http://45.33.79.118/satis/web/

To add our composer packages repository to composer.json add this lines:

@Djuki
Djuki / crucible_up.sh
Created December 25, 2015 10:58
How to start Crucible when it goes down
# Connect to Codeception server
ssh forge@45.33.79.118
# go into the crucible bin folder
cd crucible/fecru-3.10.1/bin
# start crucible
sudo sh start.sh
# wait few minutes until cricible start
@Djuki
Djuki / grmm.bash
Created August 30, 2017 10:02
GIT rebase and merge with master feature branch
function grmm () {
COLOR='\033[1;37m'
echo "${COLOR} Lets merge branch: ${1}";
git fetch origin
git checkout master
git pull origin master
git checkout $1
@Djuki
Djuki / cleanup.php
Created May 15, 2018 13:14 — forked from ivanhoe011/cleanup.php
Proper way to remove all metadata from an image
<?php
$img = new Imagick($img);
// code by Max Eremin http://php.net/manual/en/imagick.stripimage.php#120380
// we need to keep the ICC profiles
$profiles = $img->getImageProfiles('icc', true);
// but remove everything else