Skip to content

Instantly share code, notes, and snippets.

View pinceladasdaweb's full-sized avatar
👊
The only thing I really care about is user experience.

Pedro Rogério pinceladasdaweb

👊
The only thing I really care about is user experience.
View GitHub Profile
@pinceladasdaweb
pinceladasdaweb / gist:6662290
Created September 22, 2013 18:04
Get Youtube Video Thumbnail with JavaScript.
var Youtube = (function () {
'use strict';
var video, results;
var getThumb = function (url, size) {
if (url === null) {
return '';
}
size = (size === null) ? 'big' : size;

Keybase proof

I hereby claim:

  • I am pinceladasdaweb on github.
  • I am pinceladasdaweb (https://keybase.io/pinceladasdaweb) on keybase.
  • I have a public key whose fingerprint is 7289 500F 7583 1E75 5F44 3B65 98F9 1525 3878 E289

To claim this, I am signing this object:

@pinceladasdaweb
pinceladasdaweb / imgur.js
Created March 27, 2014 13:14
Upload images to imgur via JavaScript
/*
--------------------------------
imgur Upload
--------------------------------
+ https://github.com/pinceladasdaweb/imgur-upload
+ version 1.1
+ Copyright 2014 Pedro Rogerio
+ Licensed under the MIT license
+ Documentation: https://github.com/pinceladasdaweb/imgur-upload
@pinceladasdaweb
pinceladasdaweb / install-mongodb-mac-os-x.md
Created November 13, 2018 16:16 — forked from Sydney-o9/install-mongodb-mac-os-x.md
Install MongoDB on Mac OS X without brew

1. Download latest source

# Get latest from MongoDB website
$ curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.4.6.tgz
$ tar -zxvf mongodb-osx-x86_64-3.4.6.tgz
$ mkdir -p mongodb
$ cp -R -n mongodb-osx-x86_64-3.4.6/ mongodb
$ sudo mv mongodb /usr/local
@pinceladasdaweb
pinceladasdaweb / index.html
Last active December 31, 2015 12:39
Hello World Firefox OS
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World Firefox OS (Primeira Aplicação)</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<article class="content">
<h1>Hello World <br>Firefox OS</h1>
@pinceladasdaweb
pinceladasdaweb / cep.php
Created November 29, 2013 17:40
Convert XML to JSON
<?php
class XmlToJson {
public function Parse ($url) {
$fileContents= file_get_contents($url);
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);
$fileContents = trim(str_replace('"', "'", $fileContents));
$simpleXml = simplexml_load_string($fileContents);
$json = json_encode($simpleXml);
return $json;
}
var express = require('express');
var sys = require('util');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = process.env['TWITTER_CONSUMER_KEY'];
var _twitterConsumerSecret = process.env['TWITTER_CONSUMER_SECRET'];
console.log("_twitterConsumerKey: %s and _twitterConsumerSecret %s", process.env['TWITTER_CONSUMER_KEY'], process.env['TWITTER_CONSUMER_SECRET']);
@pinceladasdaweb
pinceladasdaweb / gist:5612973
Created May 20, 2013 15:31
Restricting File Type Before Uploading with JavaScript
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Restricting File Type Before Uploading with JavaScript</title>
</head>
<body>
<input type="file" name="upload" id="upload">
@pinceladasdaweb
pinceladasdaweb / robot.js
Created December 4, 2012 17:14
Pinceladas da Web
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();
@pinceladasdaweb
pinceladasdaweb / robot.js
Created December 4, 2012 17:17 — forked from fabiopimentel/robot.js
CSS no Lanche
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();
robot.ahead(100);