Skip to content

Instantly share code, notes, and snippets.

Jordano Moscoso Xosmond

Block or report user

Report or block Xosmond

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
@Xosmond
Xosmond / Procfile
Last active Dec 18, 2018
vuerails procfile
View Procfile
web: rails s
webpack: bin/webpack-dev-server
@Xosmond
Xosmond / login.vue
Created Dec 13, 2018
vuerails login vue component
View login.vue
<style scoped>
.login-footer {
background-color: #e6e6e6;
}
</style>
<template>
<div class="bg-white rounded text-wktext">
<form :action="action" method="post">
<div class="rounded-t py-4 px-5 bg-blue">
<span class="text-base text-white text-wktext-bold">Welcome, please login</span>
@Xosmond
Xosmond / home_controller.rb
Last active Dec 18, 2018
vuerails home_controller
View home_controller.rb
class HomeController < ApplicationController
before_action :authenticate_user!
def index
end
end
@Xosmond
Xosmond / application.scss
Last active Dec 16, 2018
vuerails application.scss
View application.scss
@charset "utf-8";
// Material design input
.material-input {
label {
color: #3490dc;
left:5px;
top:10px;
transition:0.2s ease all;
}
@Xosmond
Xosmond / some.component.html
Created May 24, 2018
Replace iframe url - Angular
View some.component.html
<iframe src="oldurl" (load)="onloadhandler()" style="border: none; display:none;width: 0; height: 0;"></iframe>
<iframe [attr.src]="url" height="800" width="100%"></iframe>
@Xosmond
Xosmond / remote_sudo.rb
Created Dec 8, 2017 — forked from ainoya/remote_sudo.rb
Execute remote sudo command with net-ssh
View remote_sudo.rb
#!/usr/bin/env ruby
require 'net/ssh'
require 'highline/import'
def get_password
ask( "Enter Password: " ) {|q| q.echo = '*'}
end
def remote_sudo host, ssh_user, command, opts={}
@Xosmond
Xosmond / Capybara Selectize
Created Dec 2, 2017
Helper methods for capybara on selecting elements with selectize.js
View Capybara Selectize
def selectize_single_select(field, value)
page.execute_script %Q{ $('.#{field} .selectize-input').click(); }
page.execute_script %Q{ $('.#{field} .selectize-dropdown-content .option:contains("#{value}")').click(); }
end
def selectize_multi_select(field, *values)
values.flatten.each do |tag|
page.execute_script "$('.#{field} .selectize-input').click();"
page.execute_script %Q{ $('.#{field} .selectize-dropdown-content').children("div:contains('#{tag}')").click(); }
page.execute_script "$('body').mousedown()"
View download_zip.rb
def download_zip(image_list)
unless image_list.blank?
file_name = 'pictures.zip'
stringio = Zip::ZipOutputStream::write_buffer do |z|
z.put_next_entry("empty_folder/") ## Create a folder
image_list.each do |img|
title = img.title
title += '.jpg' unless title.end_with?('.jpg')
@Xosmond
Xosmond / install.sh
Created Aug 31, 2017 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
View install.sh
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@Xosmond
Xosmond / rspec_rails_cheetsheet.rb
Created Jul 20, 2017 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet (include capybara matchers)
View rspec_rails_cheetsheet.rb
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
You can’t perform that action at this time.