Skip to content

Instantly share code, notes, and snippets.

View vjnrv's full-sized avatar

Pedro Junior vjnrv

  • São Paulo - Brasil
View GitHub Profile
/**
* Add this script to the end of your document that use <input autofocus type="text" />
* or <input type="text" placeholder="username" /> and it'll plug support for browser
* without these attributes
* Minified version at the bottom
*/
(function () {
function each(list, fn) {
var l = list.length;
CREATE TABLE `user` (
`twitter_id` int(10) unsigned NOT NULL,
`name` varchar(140) NOT NULL,
`screen_name` varchar(30) NOT NULL,
`location` varchar(180) default NULL,
`description` varchar(300) default NULL,
`profile_image_url` varchar(400) NOT NULL,
`url` varchar(400) default NULL,
`protected` varchar(5) default NULL,
`followers_count` int(10) unsigned NOT NULL,
(function (undefined) {
function detectMutation() {
mutationSupported = true;
this.removeEventListener('DOMAttrModified', detectMutation, false);
}
var forEach = [].forEach,
regex = /^data-(.+)/,
el = document.createElement('div'),
mutationSupported = false,
<?php
//$url = 'http://twitter.com/vjnrv';
//$status = 'Testando urli.nl';
$bitly = 'http://urli.nl/api.php?&format=json&action=shorturl&url='.$url;
$result = @file_get_contents($bitly);
if($result)
{
$result = @json_decode($result, TRUE);
<?php
/**
* Get the TwitterOAuth source code:
* http://github.com/abraham/twitteroauth
* git clone git@github.com:abraham/twitteroauth.git
*
* Get your OAuth credentials:
* http://dev.twitter.com/pages/oauth_single_token
*/
<html>
<head>
<title>Google XAuth Demo</title>
<script type="text/javascript" src="http://xauth.org/xauth.js"></script>
<script type="text/javascript">
function doLogin(doneUrl) {
/* Tell XAuth.org that a user has just signed into Google on this browser. */
XAuth.extend({
// Just reveals "someone is logged into Google" but no personally identifiable info.
<script type="text/javascript">
function doLogin(doneUrl) {
/* Tell XAuth.org that a user has just signed into Google on this browser. */
XAuth.extend({
// reveals "someone is logged into Google"
token: "1",
// Expires after 24 hours or if the user explicitly logs out
expire: new Date().getTime() + 60*60*24*1000,
// Allow any domain to read this info (could also be a whitelist of partners)
extend: ["*"],
<?php
## Parse query string.
$sb_league = $_GET['league'] ? strtolower( $_GET['league'] ) : 'all';
## Nav data, as a JSON heredoc. Much less verbose than PHP arrays!
$navs = json_decode(<<<JSON
{
"mlb": {
"title_link": "http://stats.boston.com/mlb/scoreboard.asp",
var AnulaMenu = true;
var elementos = document.querySelectorAll('*'), total = elementos.length;
while(total--)
{
elementos[total].oncontextmenu = AnulaMenu ? new Function('return false') : null;
}
/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Copyright 2010, Wade Simmons
* Licensed under the MIT license