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
in=yourfile.js | |
out=yourfile.min.js | |
curl -s \ | |
-d compilation_level=SIMPLE_OPTIMIZATIONS \ | |
-d output_format=text \ | |
-d output_info=compiled_code \ | |
--data-urlencode "js_code@${in}" \ | |
http://closure-compiler.appspot.com/compile \ | |
> $out |
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($){ | |
// a tiny jquery plugin to deal with maxlength attribute on textareas | |
// TODO: how do we know when the browser is capable of implementing/handling this HTML5 attribute? | |
// can we assume if the browser supports this attribute it will handle it correctly? | |
// example usage: $('textarea[maxlength]').maxlength(); | |
$.fn.maxlength = function(){ | |
return this.bind('keydown blur', function(){ |
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
<!doctype html> | |
<html lang="en" class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<script type="text/javascript">document.documentElement.className += " js";</script> | |
<link rel="stylesheet" href="css/style.css?v=2"> | |
</head> | |
<body> |
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
#!/usr/bin/env bash | |
# | |
# build a new kohana3 project using the kohana3-examples repository | |
# https://github.com/badsyntax/kohana3-examples | |
if ! builtin type -p git > /dev/null ; then | |
echo git doesn\'t appear to be installed.; exit 1 | |
fi |
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 defined('SYSPATH') or die('No direct script access.'); | |
/* | |
* This is a Kohana3 ported version of the php-openid example consumer files | |
* see https://github.com/openid/php-openid/tree/master/examples/consumer/ | |
* For instructions see http://blog.badsyntax.co/post/1668974231/kohana3-openid-module | |
*/ | |
class Controller_Auth_OpenID extends Controller_Base { | |
protected $store_path = '/tmp/_php_consumer_test'; |
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
// See http://rosskendall.com/blog/web/javascript-function-to-check-an-email-address-conforms-to-rfc822 | |
function isEmail(email){ | |
return /^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/.test( email ); | |
} |
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
CREATE TABLE IF NOT EXISTS `config` ( | |
`id` int(11) NOT NULL auto_increment, | |
`group_name` varchar(32) character set utf8 NOT NULL, | |
`config_key` varchar(32) character set utf8 NOT NULL, | |
`label` varchar(64) character set utf8 NOT NULL, | |
`config_value` text character set utf8, | |
`default` text character set utf8, | |
`rules` text character set utf8, | |
`field_type` varchar(255) character set utf8 NOT NULL default 'text', | |
`date` timestamp NOT NULL default CURRENT_TIMESTAMP, |
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 convert(content){ | |
// This seems pretty reliable now | |
return content | |
.replace(/=\s*\n/g, '') // remove line endings | |
.replace(/=(([a-f0-9]){2})/ig, function(m, hex){ // HEX codes (format: =0A) | |
var charCode = parseInt(hex, 16); // Convert HEX code to CharCode |
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
/** | |
* @filename : editor_plugin.js | |
* @description : jQuery UI Inline Popups plugin to replace the default inlinepopups | |
* @developer : badsyntax (Richard Willis) | |
* @contact : http://badsyntax.co | |
* @moreinfo : http://is.gd/j1FuI | |
*/ | |
/* NOTE: this code is out of date, please grab the latest code from https://github.com/badsyntax/tinymce-custom-inlinepopups/blob/master/jqueryinlinepopups/ */ |
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
// Example init | |
// This should go at the end of the document | |
(function(){ | |
KO.init({ | |
environment: 'development', | |
paths: {"base":"\/admin"}, | |
param: {}, | |
route: { | |
controller: 'home', |