Skip to content

Instantly share code, notes, and snippets.

View lsmoura's full-sized avatar
😀
Happy!

Sergio Moura lsmoura

😀
Happy!
View GitHub Profile
var tiptoe = require('tiptoe'),
shared = require('shared');
function processSet(set) {
// Do something with the set
}
function getSet(setName, callback) {
// The functions inside "tiptoe()" parameters, will be executed one after another, assumming "this()" is called.
tiptoe(
@lsmoura
lsmoura / ogw.json
Created January 14, 2016 12:55
Oath of the Gatewatch initial file
{
"name": "Oath of the Gatewatch",
"code": "OGW",
"releaseDate": "2016-01-22",
"border": "black",
"type": "expansion",
"block": "Battle for Zendikar",
"booster": [
[
"rare",
@lsmoura
lsmoura / pak90.json
Created January 14, 2016 20:52
All cards with multiverseid
This file has been truncated, but you can view the full file.
{
"Air Elemental": [
{
"setCode": "LEA",
"multiverseid": 94
},
{
"setCode": "LEB",
"multiverseid": 389
},
@lsmoura
lsmoura / pak90.js
Last active January 14, 2016 21:04
Generate pak90.json
var fs = require('fs'),
path = require('path'),
tiptoe = require('tiptoe'),
mtgdb = require('mtgdb');
/*
npm install tiptoe
npm install https://github.com/mtgjson/mtgdb.git
*/
@lsmoura
lsmoura / OGW.it.json
Last active January 15, 2016 14:45
OGW italian
{
"name": "Giuramento dei Guardiani",
"code": "OGW",
"language": "it",
"cards": [
{
"artist": "Viktor Titov",
"cmc": 7,
"layout": "normal",
"manaCost": "{6}{C}",

Keybase proof

I hereby claim:

  • I am lsmoura on github.
  • I am lsmoura (https://keybase.io/lsmoura) on keybase.
  • I have a public key ASCnLHRIRFwocg1rDw-59wV8P3lbPL_07SxfDz0GE4-cRQo

To claim this, I am signing this object:

@lsmoura
lsmoura / test.js
Last active October 13, 2016 18:01
var downloadCard = function(card, callback) {
var downloaded = null;
tiptoe(
function() {
cardGrab.downloadFiles(card.multiverseid, this);
},
function(data) {
downloaded = data;
parser.oracle(card.multiverseid, data.oracle, this.parallel());
parser.printed(card.multiverseid, data.printed, this.parallel());
This file has been truncated, but you can view the full file.
{
"name": "Battle for Zendikar",
"code": "BFZ",
"releaseDate": "2015-10-02",
"border": "black",
"type": "expansion",
"block": "Battle for Zendikar",
"booster": [
[
"rare",
@lsmoura
lsmoura / flatten.js
Created December 12, 2016 19:27
Javascript flatten
// Flatten an array with possible nested array into a single array
function flatten(arr) {
if (!Array.isArray(arr))
// Do nothing if we're not an array
return(arr);
var ret = [];
var i, j;
for (i = 0; i < arr.length; i++) {
// Flatten each individual element
var aux = flatten(arr[i]);
@lsmoura
lsmoura / unstable.json
Last active December 5, 2017 16:47
unstable json changes
{
"Extremely Slow Zombie": [
{
"text": "Last Strike (This creature deals combat damage after creatures without last strike.)",
"flavor": "Brrrrrrrrrrrr..."
},
{
"text": "Last Strike (This creature deals combat damage after creatures without last strike.)",
"flavor": "...aaaaaaiiiii..."
},