Skip to content

Instantly share code, notes, and snippets.

View Zeryther's full-sized avatar
🎯

Mehdi Baaboura Zeryther

🎯
View GitHub Profile
@vxnick
vxnick / gist:380904
Created April 27, 2010 15:52
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
@jasny
jasny / linkify.php
Last active May 6, 2024 01:44
PHP function to turn all URLs in clickable links
<?php
/**
* Turn all URLs in clickable links.
*
* @param string $value
* @param array $protocols http/https, ftp, mail, twitter
* @param array $attributes
* @return string
*/
public function linkify($value, $protocols = array('http', 'mail'), array $attributes = array())
@skakri
skakri / mc_status.php
Created March 20, 2012 12:16
Minecraft status (PHP, returns MOTD, online user count, slots, request time)
<?php
/**
* @author Kristaps Karlsons <kristaps.karlsons@gmail.com>
* Licensed under MPL 1.1
*/
function mc_status($host,$port='25565') {
$timeInit = microtime();
// TODO: implement a way to store data (memcached or MySQL?) - please don't overload target server
$fp = fsockopen($host,$port,$errno,$errstr,$timeout=10);
@boogah
boogah / changelog.md
Last active April 6, 2021 14:25
DMCA Takedown Template Originally adapted from: http://www.epicorg.com/sample-dmca-take-down-notice.html
@aadnk
aadnk / ForceEnd.java
Created February 10, 2013 03:56
Force the end credits on an unsuspecting player.
package com.comphenix.example;
import net.minecraft.server.v1_4_R1.EntityPlayer;
import net.minecraft.server.v1_4_R1.Packet70Bed;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.v1_4_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
@debloper
debloper / app.js
Last active October 21, 2022 21:48
A simple WHOIS & Reverse Lookup server written in Node.js. Run `npm install express`, then `node <file>.js` to get the server(s) up
var net = require("net")
, dns = require("dns")
, exp = require("express")
, app = exp();
app.configure(function() {
app.use(exp.logger());
app.use(app.router);
});
@josephilipraja
josephilipraja / countries.php
Last active April 17, 2024 05:42
List of Countries with Country code & Telephone (Dial) Code as a PHP Array. Bonus: PHP function to list all Countries as HTML Select Tag Options with their 2 character Country code as values
<?php
$countryArray = array(
'AD'=>array('name'=>'ANDORRA','code'=>'376'),
'AE'=>array('name'=>'UNITED ARAB EMIRATES','code'=>'971'),
'AF'=>array('name'=>'AFGHANISTAN','code'=>'93'),
'AG'=>array('name'=>'ANTIGUA AND BARBUDA','code'=>'1268'),
'AI'=>array('name'=>'ANGUILLA','code'=>'1264'),
'AL'=>array('name'=>'ALBANIA','code'=>'355'),
'AM'=>array('name'=>'ARMENIA','code'=>'374'),
'AN'=>array('name'=>'NETHERLANDS ANTILLES','code'=>'599'),
<?php
/**
* ownCloud - passman
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Sander Brand <brantje@gmail.com>
* @copyright Sander Brand 2014
*/
<#
.SYNOPSIS
Resize an image
.DESCRIPTION
Resize an image based on a new given height or width or a single dimension and a maintain ratio flag.
The execution of this CmdLet creates a new file named "OriginalName_resized" and maintains the original
file extension
.PARAMETER Width
The new width of the image. Can be given alone with the MaintainRatio flag
.PARAMETER Height
@LB--
LB-- / Minecraft-Name-History.php
Last active July 31, 2016 23:23
Minecraft Name History - http://www.LB-Stuff.com/Minecraft-Name-History - really hacky PHP script, available in public domain
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Minecraft Name History - Nicholas "LB" Braden</title>
<link rel="canonical" href="http://www.LB-Stuff.com/Minecraft-Name-History" />
<link rel="stylesheet" href="/light.css" />
<link rel="icon" type="image/png" href="/LB.png" />
<script src="https://apis.google.com/js/platform.js" async defer></script>
</head>