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
@nelyj
nelyj / clear-sidekiq-jobs.sh
Created August 19, 2021 21:14 — forked from wbotelhos/clear-sidekiq-jobs.sh
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
@nelyj
nelyj / orders_controller_spec.rb
Created August 22, 2019 07:08 — forked from chsh/orders_controller_spec.rb
RSpec controller example
require 'spec_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold
# generator. If you are using any extension libraries to generate different
# controller code, this generated spec may or may not pass.
#
@nelyj
nelyj / ssl_puma.sh
Created April 23, 2019 04:32 — forked from nathancolgate/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key
$ cd ~/.ssh
$ openssl genrsa -des3 -passout pass:x -out lvh.me.pass.key 2048
# 2) Generate RSA key
$ openssl rsa -passin pass:x -in lvh.me.pass.key -out lvh.me.key
# 3) Get rid of private key
$ rm lvh.me.pass.key
@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

@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 / 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 / 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 / blind_sqli_time_based.rb
Last active September 14, 2015 21:51 — forked from Techbrunch/blind_sqli_time_based.rb
Small script for Time Based Blind SQL Injection in Ruby
require 'net/http'
require 'uri'
uri = URI.parse('http://www.test.com/index.php')
http = Net::HTTP.new(uri.host, uri.port)
hex = (('a'..'f').to_a + ('0'..'9').to_a).sort.map { |x| x.ord }
ascii = (32..127).to_a
tables = ''
@nelyj
nelyj / Contract Killer 3.md
Last active August 29, 2015 14:26 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

# Fixing permissions of packaged gems
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/10_fixing_permission.sh":
content: |
#!/usr/bin/env bash
# . /opt/elasticbeanstalk/containerfiles/envvars
. /opt/elasticbeanstalk/support/envvars
CACHE_GEM_DIR=$EB_CONFIG_APP_ONDECK/vendor/cache