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
// cross-browser width and height functions | |
function f_clientWidth() { | |
return f_filterResults ( | |
window.innerWidth ? window.innerWidth : 0, | |
document.documentElement ? document.documentElement.clientWidth : 0, | |
document.body ? document.body.clientWidth : 0 | |
); | |
} | |
function f_clientHeight() { | |
return f_filterResults ( |
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
RewriteEngine on | |
RewriteBase / | |
# Add www rule | |
# RewriteCond %{HTTP_HOST} ^example.com$ [NC] | |
# RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] | |
# Remove www rule | |
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] | |
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L] |
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 patch for HTML5 elements using innerShiv by https://github.com/andy-clusta | |
(function ($) { | |
var init = jQuery.fn.init; rootjQuery = jQuery(document); | |
// http://jdbartlett.github.com/innershiv | WTFPL License | |
var innerShiv = (function() { | |
var div, frag, | |
inaTable = /^<(tbody|tr|td|col|colgroup|thead|tfoot)/i, | |
remptyTag = /(<([\w:]+)[^>]*?)\/>/g, | |
rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i, |
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
#ifndef UTIL_LANG_RANGE_HPP | |
#define UTIL_LANG_RANGE_HPP | |
#include <iterator> | |
namespace util { namespace lang { | |
namespace detail { | |
template <typename T> |
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
package main | |
import ( | |
"bufio" | |
"container/list" | |
"flag" | |
"fmt" | |
"net/http" | |
"io" | |
"os" |
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
module Y { | |
interface Anim extends Base { | |
} | |
interface App extends App_Base, App_Content, App_Transitions, PjaxContent { | |
(config?: any); | |
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
#ifndef TEXT_STRING_HPP | |
#define TEXT_STRING_HPP | |
#include <algorithm> | |
#include <cstring> | |
#include <iterator> | |
#include <memory> | |
#include <iosfwd> | |
namespace text { |
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
enum class dna_strand : char { | |
positive = '+', | |
negative = '-' | |
}; | |
std::ostream& operator <<(std::ostream& out, dna_strand strand) { | |
return out << static_cast<char>(strand); | |
} | |
std::istream& operator >>(std::istream& in, dna_strand& strand) { |
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
CREATE ROLE readonly LOGIN PASSWORD 'some_pass'; | |
-- Existing objects | |
GRANT CONNECT ON DATABASE the_db TO readonly; | |
GRANT USAGE ON SCHEMA public TO readonly; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly; | |
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO readonly; | |
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO readonly; | |
-- New objects | |
ALTER DEFAULT PRIVILEGES FOR owner_user IN SCHEMA public GRANT SELECT ON TABLES TO readonly; | |
ALTER DEFAULT PRIVILEGES FOR owner_user IN SCHEMA public GRANT SELECT ON SEQUENCES TO readonly; |
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
template <typename Source> | |
struct auto_cast_helper { | |
Source const& value; | |
explicit auto_cast_helper(Source const& value) : value(value) { } | |
template <typename Target> | |
operator Target() const { | |
return static_cast<Target>(value); | |
} |
OlderNewer