Skip to content

Instantly share code, notes, and snippets.

@rigwild
rigwild / _maintenance_page.html
Created February 18, 2020 21:01
Maintenance page
<!DOCTYPE html>
<html>
<head>
<title>Site is down for maintenance</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body { text-align: center; padding: 10%; font: 20px Helvetica, sans-serif; color: #333; }
h1 { font-size: 50px; margin: 0; }
article { display: block; text-align: left; max-width: 650px; margin: 0 auto; }
@aalonzolu
aalonzolu / phptoken.php
Created January 19, 2018 16:32
simple method to encrypt or decrypt a plain text string with php
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
@joepie91
joepie91 / vpn.md
Last active April 19, 2025 00:38
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@champsupertramp
champsupertramp / currency_list
Last active March 17, 2025 14:09 — forked from MindaugasR/currency_list
World Currency list in PHP Array
array (
'ALL' => 'Albania Lek',
'AFN' => 'Afghanistan Afghani',
'ARS' => 'Argentina Peso',
'AWG' => 'Aruba Guilder',
'AUD' => 'Australia Dollar',
'AZN' => 'Azerbaijan New Manat',
'BSD' => 'Bahamas Dollar',
'BBD' => 'Barbados Dollar',
'BDT' => 'Bangladeshi taka',
@lukebiggerstaff
lukebiggerstaff / AJAXTable.js
Last active January 29, 2025 05:17
A script to create a mobile first responsive table using AJAX and vanilla javascript
var getTableDataAJAX = function() {
var getTableData = new XMLHttpRequest();
getTableData.onreadystatechange = function() {
if(getTableData.readyState === 4) {
var tableInfo = JSON.parse(getTableData.responseText);
var tableHeading = tableInfo.tableHeading;
var tableCellsPets = tableInfo.tableCellsPets;
var tableCellsPeople = tableInfo.tableCellsPeople;
@elliotboney
elliotboney / getemail.php
Created June 24, 2014 01:28
Grab emails from a string
<?php
function extract_emails_from($string){
preg_match_all("/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i", $string, $matches);
return $matches[0];
}
// Example useage
$text = "blah blah blah [email protected] blah blah blah [email protected]";
@codee
codee / image_autorotate.php
Last active January 24, 2025 13:23
CodeIgniter: Automatic image rotation library
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* @file application/libraries/Image_autorotate.php
*/
class Image_autorotate
{
function __construct($params = NULL) {
if (!is_array($params) || empty($params)) return FALSE;
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@mreidsma
mreidsma / .htaccess
Created July 13, 2012 20:22
Simple click tracking script
// .htaccess
//
// Add this to the directory where your write.php will be stored
// This is an easy way to do an HTTP request to the script with the data
<IfModule mod_rewrite.c>
RewriteEngine On
# Change the following to the base directory of this file
RewriteBase /clickstats/