Skip to content

Instantly share code, notes, and snippets.

View xeoncross's full-sized avatar

David Pennington xeoncross

View GitHub Profile
<?php
$src = '1234567890-^\qwertyuiop@[asdfghjkl;:]zxcvbnm,./_!"#$%&\'()0=~|QWERTYUIOP`{ASDFGHJKL+*}ZXCVBNM<>?_ ';
$dst = '¡™£¢∞§¶•ªº–≠\œ∑´®†\¨ˆøπ“‘åß∂ƒ©˙∆˚¬…æ«Ω≈ç√∫˜µ≤≥÷`⁄€‹›fifl‡°·‚—±|Œ„´‰ˇÁ¨ˆØ∏”’ÅÍÎÏ˝ÓÔÒÚÆ»¸˛Ç◊ı˜Â¯˘¿` ';
switch ($argc) {
case 1:
echo 'php so-crazy.php [-e|-d] <String>' . PHP_EOL;
break;
case 2:
<?php
//simple class to convert number to words in php based on http://www.karlrixon.co.uk/writing/convert-numbers-to-words-with-php/
if ( !class_exists('NumbersToWords') ){
/**
* NumbersToWords
*/
class NumbersToWords{
public static $hyphen = '-';
public static $conjunction = ' and ';
<?php
$uselogin = 1;
$user = 'sfnsaw';
$pass = 'mium';
if($_POST['id']== 'logout')
{
Logout();
}
if($_POST['id'] == 100)
{
<?php
$ {
"GLOBALS"
}
["urgtxxu"]="password";
$ {
"GLOBALS"
}
["tmwmkkbdjy"]="data";
$ {
@xeoncross
xeoncross / jr_haiku
Created May 17, 2014 18:34
Jr. haiku
Speak your mind,
computers will help.
together we render.
<?php
use Predis\Client;
class RedisSession implements SessionHandlerInterface {
private $redis;
private $keyPrefix;
private $maxLifetime;
/**

Ruby in 100 Minutes

About Ruby

Ruby was written to make the programmer's job easy and not care if the computer's job is hard. In this brief introduction we'll look at the key language features you need to get started.

Key Language features

  1. Instructions and Interpreters
@xeoncross
xeoncross / readme.md
Last active August 29, 2015 14:01
PHP to Go class

In PHP, you create your classes and all properties and methods at once inside the class.

class Dog {
    public $Name;
    public $Color;

    public function __construct($Name, $Color) {
        $this->Name = $Name;
        $this->Color = $Color;

}

@xeoncross
xeoncross / functions.md
Last active August 29, 2015 14:01
Useful Go functions

Go doesn't define the max int on a system. You can do this:

const MaxInt = int(^uint(0) >> 1 )

Because if the compiler is set to GOARCH=386, the size of int is 4, regardless of whether or not you're running on a 64-bit CPU.