Skip to content

Instantly share code, notes, and snippets.


Rolando Murillo rnmp

Block or report user

Report or block rnmp

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
mehiel / CountriesDropdown.js
Last active Jan 20, 2020
React: use-dropdown hook
View CountriesDropdown.js
import React, { useRef } from "react";
import useDropdown from "use-dropdown";
function CountriesDropdown(props) {
const coutriesEl = useRef(null);
const countriesDropEl = useRef(null);
const [countriesDropOpen, toggleCountriesDrop] = useDropdown(countriesDropEl, coutriesEl);
const onClick = () => toggleCountriesDrop();
return (
mani47 / string_enums.rb
Created Aug 16, 2018
String enums are useful when you want to keep the actual string instead of integer in database, This gist add the validation to make sure users are passing correct values to model.
View string_enums.rb
require 'active_support/concern'
module StringEnums
extend ActiveSupport::Concern
class_methods do
def string_enum(enums_hash)
enum_name = enums_hash.keys.first.to_s
define_singleton_method(enum_name.pluralize) do
yalab /
Last active Dec 27, 2019
rails5 + webpacker + bootstrap
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add bootstrap@4.0.0-beta jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset%C(red)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --abbrev-commit"
niksumeiko /
Last active Jan 25, 2020
Disable HTML form input autocomplete and autofill

Disable HTML Form Input Autocomplete and Autofill

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
View favicons.html
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="/apple-touch-icon-152.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144.png">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="/apple-touch-icon-120.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/apple-touch-icon-114.png">
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="/apple-touch-icon-76.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/apple-touch-icon-72.png">
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="/apple-touch-icon-60.png">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="/apple-touch-icon-57.png">
<link rel="apple-touch-startup-image" href="/apple_startup_image.png">
<link rel="icon" type="image/png" href="/favicon-16.png" sizes="16x16">
beathyate /
Last active Dec 29, 2015
Instalación de Ruby 2.1 y Rails 4.1 en OS X Mavericks

1. Instala Xcode a través del Mac App Store

2. Abre y ejecuta

xcode-select --install

3. Acepta el prompt que sale y espera a que termine de instalar.

willurd /
Last active Jan 26, 2020
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
tylermenezes / remove-rdio-garbage.js
Created Dec 9, 2012
Removes unavailable and preview albums from rdio. This is particularly useful after using the "Sync" feature, since it's useless and generates hundreds of "Unavailable" albums. Scroll to the bottom of your collection first, since it's lazy loaded.
View remove-rdio-garbage.js
var i = 0;
var count = $('.Album.unavailable,.Album.preview').length;
console.log('Found ' + count + ' albums to remove');
var timeout = 0;
var instance_i = i++;
var album = $(this);
psd / index.html
Created Jun 13, 2012
iframe thumbnail
View index.html
<!doctype html>
<title>page thumbnails using iframes and CSS3</title>
<meta charset="utf-8">
.thumbnail {
width: 300px;
height: 160px;
You can’t perform that action at this time.