This file contains hidden or 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
// sayfayı açtığında veya yenilediğinde | |
$(document).ready(function () { | |
$.ajax({ | |
type: 'POST', | |
url: "./open.php", | |
data: { | |
adminId: "123456_Yasin", | |
message: "open" | |
}, | |
async: false |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Copyright 2012-2018 Matt Martz | |
# All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or 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 | |
error_reporting(E_ALL); | |
ini_set("display_errors", 1); | |
$start = microtime(true); | |
$start_memory = memory_get_usage(); | |
$range = range(0, 100); | |
//~ $range = array(10, 20, 30, 40, 50); | |
shuffle($range); | |
$copy = $range; |
This file contains hidden or 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 hidden or 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
_composer() | |
{ | |
local cur=${COMP_WORDS[COMP_CWORD]} | |
local cmd=${COMP_WORDS[0]} | |
if ($cmd > /dev/null 2>&1) | |
then | |
COMPREPLY=( $(compgen -W "$($cmd list | awk '$0 ~ /^ .*/' | awk {'print $1'} | grep -io '[^/_,]*' | grep -v 'command')" -- $cur) ) | |
fi | |
} | |
complete -F _composer composer |
This file contains hidden or 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 hidden or 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
#!/usr/bin/env bash | |
mkdir hugeNumberOfFiles | |
for i in `seq 500`; do mkdir hugeNumberOfFiles/$i; for j in `seq 1000`; do touch hugeNumberOfFiles/$i/$j.txt; done; done | |
for i in `seq 4`; do cp -r hugeNumberOfFiles hugeNumberOfFiles$i; done | |
# hugeNumberOfFiles -> 500 folders and nested total 500000 files |
This file contains hidden or 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 hidden or 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 | |
function FibonacciGenerator() | |
{ | |
$i = 0; | |
$j = 1; | |
for(;;) { | |
yield $j; | |
list($i, $j) = array($j, $i + $j); | |
} | |
} |
This file contains hidden or 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 | |
$zip_it = "dummy_data"; // folder name | |
$zip_name = "./test.zip"; | |
$dir = realpath(__DIR__ . "/" . $zip_it); | |
$listing = scandir($dir); | |
//~ print_r($listing); | |
// die; |