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
<!-- JEITO FEIO E BOBO --> | |
<a href="javascript:void(0);">texto do link</a> | |
<!-- JEITO BUNITO --> | |
<a href="#" onclick="return false;">texto do link</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 | |
class Callable { | |
public function __invoke(array $options) { | |
print_r($options); | |
} | |
} | |
class Model { |
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
using System.Web.Mvc; | |
/* | |
* return new SimpleResult("Hello World"); | |
* return new SimpleResult(1); | |
* return new SimpleResult(1257.14); | |
* return new SimpleResult(true); | |
*/ | |
namespace Custom.Mvc | |
{ |
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
namespace Helper | |
{ | |
public static class Convert | |
{ | |
public static int ToInt(object value) | |
{ | |
try | |
{ | |
return System.Convert.ToInt32(value); | |
} |
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
anemone.focus_crawl do | |
Anemone::Page.fetch("http://www.someurl.com/searchpage/", 'some=params&to=search').links | |
end |
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
input.on("autocompleteselect", (function(self) { | |
return function(ev, ui) { | |
self.organizationId = ui.item.value; | |
self._enableContinue(); | |
} | |
})(this)); |
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 limitChars(textarea, limit, infodiv) { | |
$(textarea).observe("keyup", function(event) { | |
var text = $F(event.element()); | |
var textlength = text.length; | |
var info = $(infodiv); | |
if(textlength > limit) { | |
info.innerHTML = 'You cannot write more then ' + limit + ' characters!'; | |
event.element().setValue(text.substr(0, limit)); | |
event.stop(); |
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
# instead | |
@object_1.reload | |
@object_2.reload | |
@object_3.reload | |
@object_4.reload | |
# use | |
[@object_1, @object_2, @object_3, @object_4].each(&:reload) |
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
$ script/performance/benchmarker 50 'Date.new(2009, 1, 1)' | |
user system total real | |
#1 0.000000 0.000000 0.000000 ( 0.001889) | |
$ script/performance/benchmarker 50 'ThirdBase::Date.new(2009, 1, 1)' | |
user system total real | |
#1 0.000000 0.000000 0.000000 ( 0.000731) |
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
#!/usr/bin/env ruby | |
## git-publish-branch: a simple script to ease the unnecessarily complex | |
## task of "publishing" a branch, i.e., taking a local branch, creating a | |
## reference to it on a remote repo, and setting up the local branch to | |
## track the remote one, all in one go. you can even delete that remote | |
## reference. | |
## | |
## Usage: git publish-branch [-d] <branch> [repository] | |
## |