Skip to content

Instantly share code, notes, and snippets.

View unique1984's full-sized avatar
💭
I may be slow to respond.

Yasin KARABULAK unique1984

💭
I may be slow to respond.
View GitHub Profile
@unique1984
unique1984 / debian8-apache24-php-phtreads.md
Created September 7, 2017 19:59 — forked from VitaliyKuznetsov/debian8-apache24-php-phtreads.md
Installing PHP Pthreads on Debian 8 Jessie with Apache 2.4

Installing PHP Pthreads on Debian 8 Jessie with Apache 2.4

What we're going to be doing

  • Replacing the installed PHP with a custom compiled version with ZTS enabled (Pthreads requires it).
  • Adding the Pthreads extension through PECL.

Method

@unique1984
unique1984 / php7_pthreads.sh
Last active October 7, 2017 22:14 — forked from taytayevanson/php7_pthreads.sh
Full PHP7 Compile/Install with Pthreads
apt-get install git build-essential libcurl3-gnutls libcurl4-gnutls-dev autoconf bison libxml2 libxml2-dbg libxml2-dev libxml2-doc libxml2-utils libxml2-utils-dbg libmemcached-dev libmcrypt-dev libcurl4-openssl-dev libgd2-xpm-dev libmysqlclient-dev zlib1g-dev libmongo-client-dev libssl1.0.0-dbg libssl-dev libssl-dev libgd2-xpm-dev libcurl3-openssl libcurl4-openssl-dev
git clone https://github.com/php/php-src.git
cd php-src
git checkout PHP-7.0.4
cd ext
git clone https://github.com/krakjoe/pthreads.git
cd ..
@unique1984
unique1984 / README
Created August 14, 2018 08:17 — forked from bert/README
Bresenham Algorithms in C
Some possible implementations of the Bresenham Algorithms in C.
The Bresenham line algorithm is an algorithm which determines which points in an
n-dimensional raster should be plotted in order to form a close approximation
to a straight line between two given points.
It is commonly used to draw lines on a computer screen, as it uses only integer
addition, subtraction and bit shifting, all of which are very cheap operations
in standard computer architectures.
It is one of the earliest algorithms developed in the field of computer graphics.
A minor extension to the original algorithm also deals with drawing circles.
@unique1984
unique1984 / phpstorm.protokol.md
Created February 24, 2019 06:01 — forked from sarpdorukaslan/phpstorm.protokol.md
phpstorm için protokol (URI) işleyici ekler [Ubuntu \ xFCE]

mimeapps.list içine [Added Associations] altında bir satıra
aşağıdaki satırı ekle

x-scheme-handler/phpstorm=phpstorm-php.desktop

phpstorm-php.desktop içeriği

[Desktop Entry]
Type=Application
Name=PHPStorm IDE
console.log("---> Running");
const curl = require("curl");
const jsdom = require("jsdom");
const url = "http://www.imdb.com/list/ls004489992/";
curl.get(url, null, (err,resp,body)=>{
if(resp.statusCode == 200){
parseData(body);
}
<?php
require_once __DIR__.'/V8JsNodeModuleLoader_FileAccessInterface.php';
require_once __DIR__.'/V8JsNodeModuleLoader_NormalisePath.php';
/**
* Simple Node.js module loader for use with V8Js PHP extension
*
* This class understands Node.js' node_modules/ directory structure
* and can require modules/files from there.
*
# wget -O "/etc/X11/xorg.conf" https://gist.githubusercontent.com/unique1984/1d29e8caaf649546ff0bc07769b834af/raw/8140fc06dd02daae33ec7cae6aabcf6225c6dcd3/X11%2520Dummy%2520configuration.txt
# This xorg configuration file will start a dummy X11 server.
# move it to /etc/X11/xorg.conf
# don't forget apt install xserver-xorg-video-dummy;
# based on https://xpra.org/Xdummy.html
Section "ServerFlags"
Option "DontVTSwitch" "true"
Option "AllowMouseOpenFail" "true"
Option "PciForceNone" "true"
@unique1984
unique1984 / average-geolocation.js
Created September 20, 2019 08:26 — forked from tlhunter/average-geolocation.js
Calculate the center/average of multiple GeoLocation coordinates
/**
* Calculate the center/average of multiple GeoLocation coordinates
* Expects an array of objects with .latitude and .longitude properties
*
* @url http://stackoverflow.com/a/14231286/538646
*/
function averageGeolocation(coords) {
if (coords.length === 1) {
return coords[0];
}
@unique1984
unique1984 / docker-help.md
Created October 27, 2019 04:28 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@unique1984
unique1984 / psql-with-gzip-cheatsheet.sh
Created February 18, 2020 19:28 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database