Skip to content

Instantly share code, notes, and snippets.


MDMCDC anovsiradj

View GitHub Profile
yidas /
Last active Apr 6, 2022
JavaScript HTML Entities Encode & Decode
azyobuzin / Dockerfile
Last active Nov 19, 2020
Wine 上で Mono を動かすやつ
View Dockerfile
FROM ubuntu:17.04
# apt-get update がクソ遅いので日本サーバーに変更
RUN sed -i 's|//archive\.ubuntu\.com|//jp\.archive\.ubuntu\.com|g' /etc/apt/sources.list
RUN dpkg --add-architecture i386 && \
apt-get update -y && \
apt-get install -y wget apt-transport-https software-properties-common && \
wget -O - | apt-key add - && \
apt-add-repository -y && \
anonymous / overpass.geojson
Created Apr 26, 2017
data exported by overpass turbo
View overpass.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
bladeSk / SQLite-PHP-quickstart.php
Last active Jul 12, 2022
SQLite3 PHP Quickstart Tutorial
View SQLite-PHP-quickstart.php
// This file walks you through the most common features of PHP's SQLite3 API.
// The code is runnable in its entirety and results in an `analytics.sqlite` file.
// Create a new database, if the file doesn't exist and open it for reading/writing.
// The extension of the file is arbitrary.
$db = new SQLite3('analytics.sqlite', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE);
// Errors are emitted as warnings by default, enable proper error handling.
hikari-no-yume / example.php
Created Mar 20, 2017
function chaining for PHP 7
View example.php
<?php declare(strict_types=1);
require_once "✨.🐘";
shakee93 / .htaccess
Created Jan 31, 2017
Laravel Apache hide .env and several security settings via .htaccess
View .htaccess
# Disable Directory listing
Options -Indexes
# block files which needs to be hidden // in here specify .example extension of the file
<Files ~ "\.(env|json|config.js|md|gitignore|gitattributes|lock)$">
Order allow,deny
Deny from all
# in here specify full file name sperator '|'
aaronpk / canonical.php
Created Dec 20, 2016
Given an input URL, find the canonical URL after following redirects and looking at rel=canonical
View canonical.php
if(!isset($_GET['url'])) {
<form action="" method="get">
<input type="url" name="url">
<input type="submit" value="Go">
freekrai / demo.php
Last active Jul 9, 2022
PHP session-based rate limiter for APIs
View demo.php
// in this sample, we are using the originating IP, but you can modify to use API keys, or tokens or what-have-you.
$rateLimiter = new RateLimiter($_SERVER["REMOTE_ADDR"]);
$limit = 100; // number of connections to limit user to per $minutes
$minutes = 1; // number of $minutes to check for.