Skip to content

Instantly share code, notes, and snippets.

View jaydson's full-sized avatar
🏠
Working from home

Jaydson Gomes jaydson

🏠
Working from home
View GitHub Profile
js> isNaN(null);
false
js> null > -1;
true
js> null < 1;
true
js> null > 0;
false
js> null < 0;
false
@jaydson
jaydson / browserid.js
Created July 22, 2011 06:10
BrowserID test for Blog Post in Jaydson.org
<html>
<head>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js' type="text/javascript"></script>
<script src="https://browserid.org/include.js"></script>
</head>
<body>
<img id="sign-in" src="https://browserid.org/i/sign_in_green.png" alt="Sign in">
<div id="logged" style='display:none'></div>
<script>
$("#sign-in").bind("click", function(){
@jaydson
jaydson / readyelement.js
Created November 11, 2011 18:36
How to observe when an element is created
var readyElement = (function(){
return {
observe : function(id,callback){
var interval = setInterval(function(){
if(document.getElementById(id)){
callback(document.getElementById(id));
clearInterval(interval);
}
},60);
}
@jaydson
jaydson / gist:1478713
Created December 14, 2011 21:49
Simple function to deal with big nesting objects
var use = function(package){
var steps = package.split('/'), /* Nesting */
pack = window[steps[0]]; /* Global reference */
/* Remove first element */
steps.shift()
/* Errors */
if(steps.length < 1){
throw "Hmm, why don't you provided a package? ";
@jaydson
jaydson / gist:1780598
Created February 9, 2012 15:11
How to detect a click event on a cross domain iframe
var myConfObj = {
iframeMouseOver : false
}
window.addEventListener('blur',function(){
if(myConfObj.iframeMouseOver){
console.log('Wow! Iframe Click!');
}
});
document.getElementById('YOUR_CONTAINER_ID').addEventListener('mouseover',function(){
@jaydson
jaydson / uri.js
Created May 10, 2012 03:42 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@jaydson
jaydson / packman.js
Created May 31, 2012 15:06
package manager prototype
/*global window, console, document,XMLHttpRequest, setTimeout, location, navigator*/
(function () {
'use strict';
// private methods and properties are stored in this object
var core = {
// Constructor
init : function () {
core.parsePackages();
Error in user YAML: (<unknown>): did not find expected comment or line break while scanning a block scalar at line 1 column 1
---

> **Atenção**: esse guia está em fase de construção, esperamos sua contribuição :)

---

Como organizar um evento Front-End?

Um guia elaborado por membros da BrazilJS Foundation para auxiliar aqueles que procuram organizar um evento sobre desenvolvimento front-end no Brasil.

@jaydson
jaydson / README.md
Created February 19, 2013 20:35 — forked from oodavid/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@jaydson
jaydson / list-svn-users
Created September 4, 2013 18:13
List SVN users by date
svn log -r {2013-01-01}:{2013-09-04} --quiet | grep "^r" | awk '{print $3}' | sort | uniq