Skip to content

Instantly share code, notes, and snippets.

Boris Barroso boriscy

Block or report user

Report or block boriscy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
boriscy / getUrlParams.js
Last active Nov 29, 2018
replace of jQuery.param
View getUrlParams.js
* Converts an Object to params similar to jQuery.param function
* @param {Object} params
* @param {Array} keys
* @return {String}
getUrlString (params, keys = [], isArray = false) {
const p = Object.keys(params).map(key => {
let val = params[key]
View tricks.exs
# Generate alphabet
for n <- ?a..?z, do: n
for n <- ?a..?z, do: << n :: utf8 >>
View a_b.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 45 columns, instead of 40. in line 2.

Bank: Banco BISA S.A.

Bank Address: Calle Ramon Loayza N. 178 ZONA CENTRAL



Bank account: 090873-501-3

boriscy / transacció
Created Nov 29, 2017
Explicación de bonsaiERP
View transacció

Bonsai usa una caracteristica de ppostgresql llamada schemas cada schema puede almacener todas las tablas de una organizacion, cuando se crea una nueva organizacion se crea todas las tablas, por ejemplo si creo la organización mi org el schema sera mi_org y tendra las tablas solo para esa organizacion, es como tener otra base de datos con las mismas tablas que la principal.

Para poder integrar con un ingreso el modulo de facturacion hay que relacionarlo con Income entonces cuando entres en la vista del Income que seria incomes/:id puedes adicionar un botón que diga crear factura, en factura almacenas.

Las tablas relacionadas para un Income son:

View option.rb
class Option < ActiveRecord::Base
validates :key , :presence => {:message => '<span style= "color: red">Es necesario este Campo</span>'}
validates :key, :uniqueness => { :message => '<span style= "color: red">Ya se establecio el valor de este parametro.</span>'}
enum prime: [:no,:yes]
enum quote: [:quote_1]
VALUES_BY_DEFAULT = %w(shopping_cart_default_value
View messaging_service.ex
# web/services/messaging_service.ex
defmodule Publit.MessagingService do
@moduledoc """
Service to send notifications to the user
@message_api Application.get_env(:publit, :message_api)
def status_code(resp) do
{_s, msg} = resp
{:error, msg}
boriscy / registration.ex
Created Nov 9, 2016
Define types on structs Elixir
View registration.ex
defmodule Registration do
defstruct [:email, :password, :name, :category, :address]
@type t :: %RegistrationService{
email: String.t,
password: String.t,
name: String.t,
category: String.t,
address: String.t
boriscy /
Last active Aug 3, 2016
Guide for queries done on PostgreSQL


Select inside a json field with array

select, f.file_name, p->'trade_name' as trade_name, m->'cin_add' as cin_add
from frac_reports f, jsonb_array_elements((>>'products')::jsonb) p,
jsonb_array_elements(p->'materials') m
where = 65933
boriscy / permit_and_plug_ohio.js
Created Jul 26, 2016
Download data for Permits and Plug for Ohio
View permit_and_plug_ohio.js
var casper = require('casper').create();
var url = '';
casper.userAgent("Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36");
casper.then(function(arg) {
//this.capture('a.png', {top: 100, left: 100, width: 700, height: 500});
this.fillSelectors('#aspnetForm', {
'#ctl00_ContentPlaceholder1_rdp_ApplicationIssuedStart_dateInput': '12/1/2014',
You can’t perform that action at this time.