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
# ------------------------------------------------------------------------------ | |
# Redirecionar para mobile a partir do agente de usuário | |
# ------------------------------------------------------------------------------ | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC] | |
RewriteRule ^$ http://m.example.com/ [L,R=302] | |
</IfModule> | |
<IfModule mod_rewrite.c> | |
RewriteEngine On |
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
// Basic jQuery plugins initialization | |
var MyNamespace = MyNamespace || {}; | |
MyNamespace.applyPlugins = function(parent) { | |
if (!parent) | |
parent = $('body'); | |
$('[data-focus=auto]', parent).focus(); | |
var richEdits = $('textarea[data-rich=true]'); |
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 | |
// Author's recommendation | |
use Respect\Validation\Validator as v; | |
$number = 123; | |
v::numeric()->validate($number); //true | |
// The author method can be a little uncomfortable, because | |
// the 'v' alias will be present in all source code and it | |
// is meaningless according OOP. |
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 | |
/** | |
* Serializes a closure as string | |
* @param \Closure $closure | |
* @return string | |
*/ | |
function serializeClosure(\Closure $closure) { | |
$ref = new ReflectionFunction($closure); | |
$tokens = token_get_all(file_get_contents($ref->getFileName())); |
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
function parseURL(url) | |
{ | |
var a = document.createElement('a'); | |
a.href = url; | |
return { | |
'href': a.href | |
, 'scheme': a.protocol | |
, 'host': a.host | |
, 'port': a.port | |
, 'path': a.pathname |
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
body { | |
-webkit-font-smoothing: antialiased; | |
-moz-font-smoothing: antialiased; | |
-ms-font-smoothing: antialiased; | |
font-smoothing: antialiased; | |
-moz-text-shadow: 0 0 1px rgba(0, 0, 0, 0.01); | |
-ms-text-shadow: 0 0 1px rgba(0, 0, 0, 0.01); | |
text-shadow: 0 0 1px rgba(0, 0, 0, 0.01); | |
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
Original work Copyright (c) 2013 Acme Corp | |
Modified work Copyright (c) 2013 Tasso Evangelista | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
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
import sys | |
from gi.repository import Gtk, Gdk, WebKit | |
class WebKitWindow(Gtk.Window): | |
scrolls = None | |
webView = None | |
def __init__(self, url, transparent=False): | |
Gtk.Window.__init__(self, Gtk.WindowType.TOPLEVEL, title='') | |
self.scrolls = Gtk.ScrolledWindow() |
OlderNewer