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

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 / 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
<script>
const render = function (posts) {
posts.responseData.feed.entries.forEach((post, index) => {
console.log(post.title);
console.log(post.content);
console.log(post.link);
});
};
new Feeder({
/**
* supplant() does variable substitution on the string. It scans through the string looking for
* expressions enclosed in { } braces. If an expression is found, use it as a key on the object,
* and if the key has a string value or number value, it is substituted for the bracket expression
* and it repeats.
*
* Written by Douglas Crockford
* http://www.crockford.com/
*/
String.prototype.supplant = function (o) {
// HOPED-FOR BEHAVIOR: /cats says: Cats Home
// ACTUAL BEHAVIOR: /cats says: Main Wildcard
var express = require('express');
var app = express();
app.get('/', function(req, res) {
res.send('Main Home');
})
@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 / 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;
}
@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;
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']);