Skip to content

Instantly share code, notes, and snippets.

View nelyj's full-sized avatar
👁️
25/8

Nelson Jiménez nelyj

👁️
25/8
View GitHub Profile
$.fn.extend
dynamicSelectable: ->
$(@).each (i, el) ->
new DynamicSelectable($(el))
class DynamicSelectable
constructor: ($select) ->
@init($select)
init: ($select) ->
require 'khipu-api-client'
2
3 Khipu.configure do |c|
4 c.secret = ENV['KHIPU_SECRET']
5 c.receiver_id = ENV['KHIPU_RECEIVER_ID']
6 c.platform = 'Kiipet' # (optional) please let us know :)
7 c.platform_version = '0.1'
8 end
@nelyj
nelyj / gist:977e9d8bc7a2d179eaa7
Created December 1, 2015 19:38
Modelo de booking
1 require_relative './concerns/bookable'
2
3 class Booking < ActiveRecord::Base
4 include Bookable
5
6 belongs_to :profile
7 belongs_to :service
8
9 def payment!(current_user)
10 amount = 1
@nelyj
nelyj / xmlsec.xml
Last active May 30, 2016 06:10
XMLSEC format
<References>
<Book>
<Author>
<FirstName>Bruce</FirstName>
<LastName>Schneier</LastName>
</Author>
<Title>Applied Cryptography</Title>
</Book>
<Web>
<Title>XMLSec</Title>
@nelyj
nelyj / Transantiago public endpoints.md
Created July 12, 2017 03:10 — forked from radutzan/Transantiago public endpoints.md
APIs REST públicas con data del Transantiago. Respuestas en JSON.

Paraderos alrededor de un punto

http://www.transantiago.cl/restservice/rest/getpuntoparada?lat=-33.6089714&lon=-70.5742975&bip=1

Estimación de parada

http://www.transantiago.cl/predictor/prediccion?codsimt=PA420&codser=504 (código de servicio es opcional, pero el parámetro debe estar presente aunque esté vacío)

Lista de servicios

http://www.transantiago.cl/restservice/rest/getservicios/all

Info completa de servicio

@nelyj
nelyj / commands
Created October 29, 2017 18:38
My vim commands
:Goyo
:Limelight0.7
:Ack search
ctrp + p search file
ctrl n: Nerdtree
ghi show issues
@nelyj
nelyj / install_puma_gem.sh
Created November 23, 2017 15:33 — forked from ikennaokpala/install_puma_gem.sh
install puma gem on el capitan
brew install openssl
brew link --force openssl
gem install puma
ALternatively:
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export LDFLAGS="-L/usr/local/opt/openssl/lib"
gem install puma
@nelyj
nelyj / folio_scrapping.rb
Last active December 31, 2017 02:08
SII scrapping to get folios
#mi github: https://github.com/nelyj
require 'uri'
require 'net/http'
url = "https://maullin.sii.cl/cvc_cgi/dte/of_solicita_folios"
headers = { "User-Agent" => "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3",
"Referer" => "https://hercules.sii.cl/cgi_AUT2000/autInicio.cgi?referencia=https://maullin.sii.cl/cvc_cgi/dte/of_solicita_folios",
"Content-Type" => "application/x-www-form-urlencoded" }
uri = URI.parse(url)
@nelyj
nelyj / notes.md
Created September 8, 2018 23:15 — forked from michaelminter/notes.md
FIXME, TODO, and OPTIMIZE code comments

You can add some special notes to your source code comments in Rails to remind you later of stuff you need to do:

class Article < ActiveRecord::Base
  # TODO add named_scopes
  # FIXME method A is broken
  # OPTIMIZE improve the code 

  has_many :comments
  ....

end

@nelyj
nelyj / tmux.md
Created October 18, 2018 01:40 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a