This file contains hidden or 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 | |
function showOAuthError($error, $error_description){ | |
if($error == 'access_denied'){ | |
header("Location: http://".$_SERVER['HTTP_HOST']); | |
}else{ | |
$error = '<strong>Error: '.$error.'</strong> | |
<p>'.preg_replace('/\+/', ' ', $error_description).'</p>'; | |
die($error); | |
}; |
This file contains hidden or 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 | |
if((!isset($_COOKIE) || !isset($_GET['r'])) || $_GET['r'] != $_COOKIE['r']){ | |
$rnd = md5(mt_rand()); | |
if($_SERVER['QUERY_STRING'] && !$_GET['r']){ | |
$s = '?' . $_SERVER['QUERY_STRING'] . '&r='.$rnd; | |
}else{ | |
$s = '?r='.$rnd; | |
}; | |
This file contains hidden or 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
#!/bin/sh | |
# | |
# chkconfig: 35 99 99 | |
# description: Node.js /home/nodejs/sample/app.js | |
# | |
. /etc/rc.d/init.d/functions | |
USER="nodejs" |
This file contains hidden or 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 Database extends Core { | |
private | |
$link, | |
$db_vars, | |
$enconing = 'utf8'; | |
public function __construct($host, $db, $user, $pass){ | |
$this->db_vars = new stdClass(); | |
This file contains hidden or 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
function humanizeDate(date, output_with_time) { | |
if(!(Object.prototype.toString.call(date) === "[object Date]")){ | |
var t = date.split(/[- :]/); | |
date = new Date(t[0], t[1] - 1, t[2], t[3], t[4], t[5]); | |
} | |
if (!date) { | |
return '—'; | |
} |
This file contains hidden or 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 Templates = function(){ | |
this.tmpls = {}; | |
function renderer(html, data){ | |
for (var p in data) { | |
if (data.hasOwnProperty(p)) { | |
html = html.replace(new RegExp('%' + p + '%', 'g'), data[p]); | |
} | |
} |
This file contains hidden or 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
(function ($) { | |
$.fn.KVNum = function (method) { | |
var settings = { | |
}; | |
function process($input){ | |
var input = $($input)[0]; | |
var value = $input.val(), |
This file contains hidden or 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
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; |
This file contains hidden or 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
<link rel="import" href="../google-map/google-map.html"> | |
<link rel="import" href="../notification-elements/notification-alert.html"> | |
<link rel="import" href="../paper-button/paper-button.html"> | |
<link rel="import" href="../paper-calculator/paper-calculator.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { |
This file contains hidden or 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 UIClickOutside = function(container, onClickOutside){ | |
var $container = $(container); | |
this.bind = function(){ | |
$(document).on('mouseup.UIClickOutside', function (e){ | |
if (!$container.is(e.target) && $container.has(e.target).length === 0){ | |
if(onClickOutside) onClickOutside(e.target); | |
} | |
}); | |
}; |
OlderNewer