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 | |
// .phpファイルをアップロードできないように | |
function sanitize($filename) { | |
$allowed_extensions = [ | |
'jpg', | |
'jpeg', | |
'png', | |
'txt', | |
'html', |
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
cd | |
VERSION=$(php -r 'echo phpversion();') | |
wget https://www.php.net/distributions/php-$VERSION.tar.gz | |
tar xf php-$VERSION.tar.gz | |
cd php-$VERSION/ext/exif | |
phpize | |
./configure | |
make | |
echo n | make test | |
make install |
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
cd | |
VERSION=$(php -r 'echo phpversion();') | |
wget https://www.php.net/distributions/php-$VERSION.tar.gz | |
tar xf php-$VERSION.tar.gz | |
cd php-$VERSION/ext/pdo_mysql | |
phpize | |
./configure | |
make | |
make test | |
make install |
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
// ==UserScript== | |
// @name 新しいスクリプト 421815 | |
// @version 1 | |
// @match https://wiki.greasespot.net/GM.xmlHttpRequest | |
// @match http://example.com/ | |
// @grant GM.xmlHttpRequest | |
// ==/UserScript== | |
function get(url) { | |
return new Promise(resolve => { |
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
const days = 365 | |
const urls = ['', ...[...Array(days).keys()].map(i=>i+1).map(i=>new Date(Date.now() - 1000*60*60*24*i).toLocaleDateString('sv').replaceAll('-', '')).map(d => '/' + d)].map(path => 'https://b.hatena.ne.jp/hotentry/it' + path) | |
const htmls = await Promise.all(urls.map(url => fetch(url).then(r=>r.text()))) | |
const docs = htmls.map(html => new DOMParser().parseFromString(html,'text/html')) | |
function countAndSort(arr) { | |
return Object.entries(arr.reduce((prev, curr) => (prev[curr] = ++prev[curr] || 1, prev), {})).sort((a,b) => b[1]-a[1]) | |
} |
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
let getRandomBytes = ( | |
(typeof self !== 'undefined' && (self.crypto || self.msCrypto)) | |
? function() { // Browsers | |
var crypto = (self.crypto || self.msCrypto), QUOTA = 65536; | |
return function(n) { | |
var a = new Uint8Array(n); | |
for (var i = 0; i < n; i += QUOTA) { | |
crypto.getRandomValues(a.subarray(i, i + Math.min(n - i, QUOTA))); | |
} | |
return a; |
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
sudo dnf install -y net-tools libnsl nano wget \ | |
&& curl -LO https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/8.2.0/xampp-linux-x64-8.2.0-0-installer.run \ | |
&& chmod +x xampp-linux-x64-8.2.0-0-installer.run \ | |
&& sudo ./xampp-linux-x64-8.2.0-0-installer.run --mode unattended \ | |
&& echo 'PATH="/opt/lampp/bin:$PATH"' >> ~/.bashrc \ | |
&& source ~/.bashrc \ | |
&& sudo /opt/lampp/lampp start | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" |
We can't make this file beautiful and searchable because it's too large.
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
news,type | |
"China had role in Yukos split-up | |
China lent Russia $6bn (£3.2bn) to help the Russian government renationalise the key Yuganskneftegas unit of oil group Yukos, it has been revealed. | |
The Kremlin said on Tuesday that the $6bn which Russian state bank VEB lent state-owned Rosneft to help buy Yugansk in turn came from Chinese banks. The revelation came as the Russian government said Rosneft had signed a long-term oil supply deal with China. The deal sees Rosneft receive $6bn in credits from China's CNPC. | |
According to Russian newspaper Vedomosti, these credits would be used to pay off the loans Rosneft received to finance the purchase of Yugansk. Reports said CNPC had been offered 20% of Yugansk in return for providing finance but the company opted for a long-term oil supply deal instead. Analysts said one factor that might have influenced the Chinese decision was the possibility of litigation from Yukos, Yugansk's former owner, if CNPC had become a shareholder. Rosneft and VEB declined to comme |
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
# https://github.com/dbrgn/coverage-badge/blob/ea399fc586eb00ec7f77e355a2e4b2b7cebd24c1/tests/test_output.py#L49 | |
p=$(printf %.0f $(grep -Pom1 '(?<=aria-valuenow=").*?(?=")' reports/index.html)) | |
color=$([[ $p -gt 96 ]] && echo 4c1 || ([[ $p -gt 92 ]] && echo 97CA00 || ([[ $p -gt 79 ]] && echo a4a61d || ([[ $p -gt 64 ]] && echo dfb317 || ([[ $p -gt 44 ]] && echo fe7d37 || ([[ $p -gt 14 ]] && echo e05d44 || echo 9f9f9f)))))) | |
wget -O reports/badge.svg https://shields.io/badge/coverage-$p%25-$color?logo=github |
NewerOlder