- Replacing the installed PHP with a custom compiled version with ZTS enabled (Pthreads requires it).
- Adding the Pthreads extension through PECL.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
OlderNewer