Skip to content

Instantly share code, notes, and snippets.

View roadev's full-sized avatar
🎯
Focusing

Juan Roa roadev

🎯
Focusing
View GitHub Profile
@AllThingsSmitty
AllThingsSmitty / apple-mq.css
Last active June 23, 2022 19:56
iPhone 6/6 Plus and Apple Watch CSS media queries
/* iPhone 6 landscape */
@media only screen and (min-device-width: 375px)
and (max-device-width: 667px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 2)
{ }
/* iPhone 6 portrait */
@media only screen
and (min-device-width: 375px)
@0
0 / bluetooth_serial.md
Last active February 6, 2024 15:17
Connecting a Bluetooth device for serial communication on Arch Linux.

The following are instructions for connecting a Bluetooth device for serial communication on Arch Linux using BlueZ 5.31.

Prerequisites

The following packages are required:

  • bluez: bluetoothd
  • bluez-utils: bluetoothctl, rfcomm
@roadev
roadev / rails_server_output_merit.rb
Created August 1, 2015 05:09
My view doesn't show the corrent amount of earned points - merit gem
Started POST "/solucions" for 127.0.0.1 at 2015-08-01 00:05:47 -0500
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by SolucionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"S2gf6bbCbA33KY2NNTk3F3lnBcwOFUuk0jJHgKLY3D0=", "solucion"=>{"micropost_id"=>"1", "solucion"=>"This is the content"}, "commit"=>"Crear Solución"}
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
/home/jroa/.rvm/gems/ruby-2.2.1/gems/activerecord-4.0.4/lib/active_record/associations/has_many_association.rb:76: warning: circular argument reference - reflection
/home/jroa/.rvm/gems/ruby-2.2.1/gems/activerecord-4.0.4/lib/active_record/associations/has_many_association.rb:80: warning: circular argument reference - reflection
/home/jroa/.rvm/gems/ruby-2.2.1/gems/activerecord-4.0.4/lib/active_record/associations/has_many_association.rb:84: warning: circular argument reference - reflection
/home/j
@marulango
marulango / reset.css
Created October 20, 2015 23:16
Hoja de estilo para eliminar inconsistencias a través de navegadores
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@camilonova
camilonova / script.js
Last active June 4, 2016 22:53
Utilizando la sucursal virtual de bancolombia es frustrante tener que escribir la clave con el teclado virtual y ver esa alerta del navegador. Pega el contenido de este script en la consola del navegador para que puedas escribir la clave con el teclado. Ver en acción: http://giphy.com/gifs/l0K4hGF22s2AojfAA
function blockEnter(evt) {return true;}
function validarNoUsarTecladoReal_OnKeyPress(_object){return false;}
/**
* An implementation for Quicksort. Doesn't
* perform as well as the native Array.sort
* and also runs the risk of a stack overflow
*
* Tests with:
*
* var array = [];
* for(var i = 0; i < 20; i++) {
* array.push(Math.round(Math.random() * 100));
<!-- in the header -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="scripts/jquery-2.1.1.min.js"><\/script>')</script>
<!-- document ready -->
<script>
$(document).ready(function() {
var customHTML = "<h2>Jeg elsker brød</h2>"
@arteezy
arteezy / puma.service
Last active April 23, 2024 00:31
Manage Puma with systemd and rbenv
[Unit]
Description=Puma Rails Server
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/home/deploy/app/current
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop
require 'csv'
CSV.foreach('app/services/rg_list.csv', headers: true) do |row|
Person.find_or_create_by name: row['Name'].to_s.split.map(&:capitalize).join(' '), email: row['Email'].to_s.downcase, gender: row['Gender'].to_s.downcase
end
CSV.foreach('app/services/rg17_register_full.csv', headers: true) do |row|
Person.find_or_create_by name: row['Name'].to_s.split.map(&:capitalize).join(' '), email: row['Email'].to_s.downcase.strip, gender: row['Gender'].to_s.downcase, register_date: row['register_date'].to_s.downcase, birth_date: row['birth_date'].to_s, phone: row['phone'].to_s.downcase.strip, level: row['level'].to_s.downcase, motivation: row['motivation'].to_s.downcase, heard_ror: row['heard_ror'].to_s.downcase, laptop: row['laptop'].to_s.downcase, so: row['so'].to_s.downcase, expectation: row['expectation'].to_s.downcase, how_did_you_find_it: row['how_did_you_find_it'].to_s.downcase
end
@alea12
alea12 / crontab
Created March 28, 2017 02:50
Nginx + Let's Encrypt + Rails5 + Puma
00 05 01 * * /home/alea12/letsencrypt/letsencrypt-auto certonly --webroot -w /var/www/html -d example.net --renew-by-default && nginx -t && nginx -s reload