Skip to content

Instantly share code, notes, and snippets.

View shingonoide's full-sized avatar

Rui Andrada shingonoide

View GitHub Profile
@shingonoide
shingonoide / gist:3d93f156c32bde2726529df649dfe443
Created March 24, 2018 17:51
Verify my for my Blockstack ID
Verifying my Blockstack ID is secured with the address 1PCcZG6DpWgg2w686ebbiS9Q3L28qtGiTt https://explorer.blockstack.org/address/1PCcZG6DpWgg2w686ebbiS9Q3L28qtGiTt
@shingonoide
shingonoide / check_url_spec_error.md
Last active September 9, 2017 03:44 — forked from RafaelPrallon/check_url.md
método, spec e erros no terminal de um método para verificar se a url tem http:// ou https://

método(localizado em app/helpers/application_helper.rb):

def check_url(url)
  return true if /^(?:(?:https\:\/\/))|(?:(?:http\:\/\/))/.match(url)
  return false
end

spec(localizado em spec/models/user_spec.rb):

01-03-2017 @ 14:39:22 - Getting the order installments...
01-03-2017 @ 14:39:22 - request[headers]:Array
(
)
01-03-2017 @ 14:39:22 - request[body]:{"api_key":"recorrenteNet_b0c03713-a906-4f03-8d69-d668b68cd99c","amount":10300,"interest_rate":"1","max_installments":"12","free_installments":"10"}
01-03-2017 @ 14:39:22 - request[to]: https://recorrente.net/1/transactions/calculate_installments_amount
01-03-2017 @ 14:39:23 - Failed to get the installments: Array
(
[headers] => Requests_Utility_CaseInsensitiveDictionary Object
@shingonoide
shingonoide / README.md
Last active July 26, 2016 20:10
Patch for ruby-1.9.3-(p551) compile

Patch for apply ruby version 1.9.3

rbenv

curl -fsSL https://gist.githubusercontent.com/shingonoide/4829adebbb6387036f27723ddd44bb3b/raw/ruby_openssl_1.9.3.patch | rbenv install --patch 1.9.3-p551

@shingonoide
shingonoide / cleanup_odoo_session.sh
Last active August 30, 2023 14:27
Simple script to clean up Odoo session files
#!/bin/sh
# example
# add this to crontab -e of odoo user
# curl -sL https://gist.github.com/shingonoide/1947a97e3c00168372e950a6788ce9ad/raw/cleanup_odoo_session.sh > /tmp/cleanup_sessions.sh && sh /tmp/cleanup_sessions.sh 4
HOW_OLDER=${1:-6}
VERBOSE=${2:-0}
SESSION_FOLDER="$HOME/.local/share/Odoo/sessions"
TOTALFILES=$(find $SESSION_FOLDER -name '*.sess' | wc -l)
@shingonoide
shingonoide / keybase.md
Created June 20, 2016 07:02
My keybase proof

Keybase proof

I hereby claim:

  • I am shingonoide on github.
  • I am shingonoide (https://keybase.io/shingonoide) on keybase.
  • I have a public key ASD9Vww-BH1NvdsPNpnGdOxO4Tg0gHSSovLoA_Zt8QXlQAo

To claim this, I am signing this object:

@shingonoide
shingonoide / dabblet.css
Last active August 29, 2015 14:28 — forked from chriscoyier/dabblet.css
Checkbox Hack
/* Checkbox Hack */
input[type=checkbox] {
position: absolute;
top: -9999px;
left: -9999px;
}
label {
-webkit-appearance: push-button;
-moz-appearance: button;
@shingonoide
shingonoide / module_core.py
Last active August 29, 2015 14:10
Odoo my_module simplification
# code snip for clarification
class module_core_user_input(osv.Model):
_name = "module_core.user_input"
_description = 'Module Core User Input'
_columns = {
'master_document_id': fields.many2one('qdi_core.survey', 'Master Document', required=True,
readonly=1, ondelete='restrict'),
'user_input_line_ids': fields.one2many('module_core.user_input_line',
'user_input_id', 'Inputs'),

This grouped bar chart is constructed from a CSV file storing the populations of different states by age group. The chart employs conventional margins and a number of D3 features:

@shingonoide
shingonoide / README.md
Last active August 29, 2015 14:02 — forked from mbostock/.block