Skip to content

Instantly share code, notes, and snippets.

View oscarmarcelo's full-sized avatar

Oscar Marcelo oscarmarcelo

View GitHub Profile
@oscarmarcelo
oscarmarcelo / generate_code.php
Created April 19, 2017 23:56
Generate an identifier code for invoices
<?php
define('KEY_CHARS', 'ACEFGHJKPQRSTWXYZ23456789'); // characters which cannot be confused phonetically or by bad handwriting
function generate_code($len = 6) {
$k = str_repeat('.', $len);
while ($len--) {
$k[$len] = substr(KEY_CHARS, mt_rand(0, strlen(KEY_CHARS) - 1), 1);
}
return $k;
}
@oscarmarcelo
oscarmarcelo / gulpfile.js
Last active January 17, 2016 16:35
Gulp Configuration
/*------------------------------------------------------------
Required plugins
------------------------------------------------------------*/
var gulp = require('gulp'),
sass = require('gulp-sass'),
postcss = require('gulp-postcss'),
autoprefixer = require('autoprefixer'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
@oscarmarcelo
oscarmarcelo / neonmob-list-sort.js
Last active December 20, 2015 00:19
Sort Neonmob oficial page sets
var common = [], uncommon = [], rare = [], veryRare = [], extremelyRare = [], chase = [], variant = [], itemGrid, items;
itemGrid = $("div.pod ul.item-list");
items = itemGrid.children();
items.each(function(i,e){
var rarity;
if($(this).find("div.thumb ul.attributes li.rarity i").attr("title")) {
rarity = $(this).find("div.thumb ul.attributes li.rarity i").attr("title");
}
@oscarmarcelo
oscarmarcelo / neonmob-collection-sort.js
Last active December 19, 2015 23:59 — forked from matthewsimo/neonmob-collection-sort.js
Sorts Neonmob Collections by rarity. (Bookmarklet is in the first comment)
var common = [], uncommon = [], rare = [], veryRare = [], extremelyRare = [], chase = [], variant = [], itemType, itemWrap, items;
if(document.getElementsByClassName('collection').getElementsByClassName('item-grid')){
itemWrap = $("div.collection ul.item-grid");
itemType = "grid";
}
if(document.getElementsByClassName('pod').getElementsByClassName('item-list')){
itemWrap = $("div.pod ul.item-list");
itemType = "list";
}