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 | |
class Hash extends Plugin | |
{ | |
public function pbkdf2($input, $s = null, $c = null, $kl = null, $a = null) | |
{ | |
$s = is_null($s) ? $this->config['s'] : $this->pbkdf2($s); | |
$c = is_null($c) ? $this->config['c'] : $c; | |
$kl = is_null($kl) ? $this->config['kl'] : $kl; | |
$a = is_null($a) ? $this->config['alg'] : $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
<?php | |
namespace lynx\Plugins; | |
class Auth extends Plugin | |
{ | |
public function login($user, $pass, $remember) | |
{ | |
$user = $this->db->select(array( | |
'FROM' => $this->config['table'], |
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 | |
class URL | |
{ | |
public function auto($string, $type = 'both', $attr = false, $echo = false) | |
{ | |
if ($type == 'both' || $type == 'url') | |
{ | |
$regex = '/(?<anchor><a(?:\s+(?<attr>(?:\S+?=(?:(?:\'.*?\')|(?:".*?")\s*))+))?>(?<text>.*?)<\/a\s*>)|(?<!>)(?<url>(?<proto>https?:\/{2})(?<domain>[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,3})(?<path>\/\S*)?)/i'; | |
return preg_replace_callback($regex, function($matches) | |
{ |
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 | |
namespace Framework\Controllers; | |
//include the model | |
require_once(ROOT . '/models/user.php'); | |
use \Framework\Models\UserModel as UserModel; | |
class User | |
{ |
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 | |
// Check if the cookie is already set, otherwise set some default styling options | |
// Also, we need to unserialize the value of the cookie as we are working with arrays | |
$style = !empty($_COOKIE['style']) ? unserialize($_COOKIE['style']) : null; | |
// First check if the keys in the arrays are empty, then check if it starts with # | |
$body_background_color = !empty($style['body_background_color']) ? (strpos($style['body_background_color'],"#") !== 0 ? "#". $style['body_background_color'] : $style['body_background_color']) : "#fff"; | |
$body_text_color = !empty($style['body_text_color']) ? (strpos($style['body_text_color'],"#") !== 0 ? "#". $style['body_text_color'] : $style['body_text_color']) : "#000"; | |
$body_text_size = !empty($style['body_text_size']) ? $style['body_text_size'] : 12; |
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
var net = require('net'), | |
irc = {}, config; | |
config = { | |
user: { | |
nick: '', | |
user: '', | |
real: '', | |
pass: '' | |
}, |
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
var http = require('http'), | |
events = require('events'); | |
function Twitter(options, track) | |
{ | |
var user, pass, authstring, | |
__self, req, emitter; | |
__self = this; | |
emitter = events.EventEmitter.call(this); | |
authstring = (new Buffer(options.user + ':' + options.pass, 'ascii')).toString('base64'); |
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 | |
set_time_limit(0); | |
$address = '192.168.2.102'; | |
$port = 9000; | |
$sock = socket_create(AF_INET, SOCK_STREAM, 0); | |
socket_bind($sock, $address, $port) or die('Could not bind to address'); | |
socket_listen($sock); |
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
var storage = {}; | |
if (window.localStorage) | |
{ | |
storage.get = function(name) | |
{ | |
if (window.localStorage[name] === undefined) | |
{ | |
return undefined; | |
} | |
return JSON.parse(window.localStorage[name]); |
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
/*! | |
* jQuery Form Plugin 2.83 (11-JUL-2011) | |
* Dual licensed under the MIT and GPL licenses: | |
* http://www.opensource.org/licenses/mit-license.php | |
* http://www.gnu.org/licenses/gpl.html | |
*/ | |
/** | |
* ajaxSubmit() provides a mechanism for immediately submitting | |
* an HTML form using AJAX. |
OlderNewer