Skip to content

Instantly share code, notes, and snippets.

View aozisik's full-sized avatar

Ahmet Özışık aozisik

View GitHub Profile
@aozisik
aozisik / 00.howto_install_phantomjs.md
Last active July 31, 2022 13:53 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 2.1.1

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@aozisik
aozisik / ubuntu20-php8-v8js-setup.sh
Last active May 6, 2023 08:07
Installing V8JS extension for PHP 8.0 on Ubuntu 20.x
apt-get update
# Install dependencies
apt-get install -y --no-install-recommends \
libtinfo5 libtinfo-dev \
build-essential \
curl \
git \
libglib2.0-dev \
libxml2 \
@aozisik
aozisik / .php-cs-fixer.php
Last active March 4, 2024 09:22
Swiftmade's php-cs-fixer (v3) config.
<?php
$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/*')
->notPath('storage/*')
->notPath('vendor')
->notPath('nova')
->notPath('spark')
->in([
__DIR__ . '/app',
@aozisik
aozisik / laravel-forge-zero-downtime.sh
Last active December 29, 2020 08:42
Zero downtime deploys using Laravel Forge
# Zero-downtime deployment script for Laravel Forge
#
# !!! WARNING FOR FIRST DEPLOYMENT !!!
# 1. Proceed with caution!
# During first setup this script will backup your .env file and storage folder, then DELETE your existing app directory.
# Make sure you don't have any important files inside your app directory and take a backup up beforehand as needed.
#
# 2. Your web server should now point at /current/public instead of /public
#
@aozisik
aozisik / github-transfer.rb
Created September 3, 2020 09:31
Ruby script to transfer multiple GitHub repos in one go
# How to use:
# 1- Fill in fromHandle, toHandle, personalAccessToken and repositories
# 2- Run this script from Terminal:
#
# ruby ./github-transfer.rb
#
# 3- There's no step 3.
require 'json'
require 'uri'
require 'net/http'
@aozisik
aozisik / .php_cs
Last active October 5, 2021 22:58
Swiftmade's php-cs-fixer (v2) config for Laravel
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null],
@aozisik
aozisik / XmlString.js
Last active July 8, 2020 08:17
Paw dynamically build simple XML string from key-value list
var XmlString = function() {
var wrapInTag = function(tagName, string) {
return "<" + tagName + ">" + string + "</" + tagName + ">";
};
var toTags = function(entries) {
var output = "";
for (var i = 0; i < entries.length; i++) {
if (!entries[i][2]) {
@aozisik
aozisik / flash.blade.php
Last active November 13, 2019 19:30
Laravel Flash Blade View
@if($message = Session::get('error'))
<div class="alert alert-danger">{{ $message }}</div>
@endif
@if($message = Session::get('errors'))
<div class="alert alert-danger">{{ $message->first() }}</div>
@endif
@if($message = Session::get('success'))
<div class="alert alert-success">{{ $message }}</div>
@aozisik
aozisik / .php-cs.php
Created November 10, 2019 16:41
Swiftmade PHP CS Config
<?php
return PhpCsFixer\Config::create()
->setRules(array(
'@PSR2' => true,
'array_syntax' => array('syntax' => 'short'),
'combine_consecutive_unsets' => true,
'method_separation' => true,
'no_multiline_whitespace_before_semicolons' => true,
'single_quote' => true,
@aozisik
aozisik / macos-mojave-php72-v8js.sh
Last active June 14, 2023 12:28
Installing PHP v8js on Ubuntu 18.04 Bionic or Mac OS Mojave (brew)
# This will retrieve v8 7.4.288.25 when installled
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/0a6171330678879285f2c566db9349da421d6f62/Formula/v8.rb
brew install v8.rb
brew list v8
# You will see this:
# /usr/local/Cellar/v8/7.4.288.25/bin/d8
# /usr/local/Cellar/v8/7.4.288.25/libexec/include/ (21 files)
# /usr/local/Cellar/v8/7.4.288.25/libexec/ (7 files)