Skip to content

Instantly share code, notes, and snippets.

View 0x7466's full-sized avatar
:octocat:
🚀💯🙌

Tobias Feistmantl 0x7466

:octocat:
🚀💯🙌
View GitHub Profile
//
// TFTextField.swift
// TFTextField
//
// Created by Tobias Feistmantl on 07/09/15.
// Copyright (c) 2015 Tobias Feistmantl. All rights reserved.
//
import Foundation
//
// TFImageView.swift
// Lome
//
// Created by Tobias Feistmantl on 10/09/15.
// Copyright (c) 2015 Tobias Feistmantl. All rights reserved.
//
import Foundation
import UIKit
javascript:var inputs = document.getElementsByClassName('uiButton _1sm'); for(var i=0; i<inputs.length;i++) { inputs[i].click(); }
# Check or uncheck checkboxes
check 'box-name'
uncheck 'box-name'
# Get cookies
Capybara.current_session.driver.request.cookies.[]('cookie-name')
# Click links and buttons
click_button 'button' # Only for buttons
click_link 'link' # Only for links
@0x7466
0x7466 / Gemfile
Created November 7, 2015 18:05
Default initial gemfile for Ruby 2.2.1 and Rails 4.2.4
source 'https://rubygems.org'
ruby '2.2.1'
group :development, :test do
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'byebug'
gem 'ffaker'
gem 'dotenv-rails'
@0x7466
0x7466 / database_cleaner.rb
Created November 7, 2015 18:13
Database cleaner configuration with default behavior
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, :js => true) do
@0x7466
0x7466 / Contact.swift
Created March 17, 2016 14:44
Contact class
//
// Contact.swift
// Debtly
//
// Created by Tobias Feistmantl on 17/01/16.
// Copyright © 2016 Tobias Feistmantl. All rights reserved.
//
import Foundation
import Contacts
@0x7466
0x7466 / routes.rb
Last active August 8, 2016 19:14
SEO friendly root URL in Rails
Rails.application.routes.draw do
# This isn't the best solution
# if you want to get to the
# root page and you do I18n,
# because it adds a parameter
# if you link to the root page.
#
# FormHelper Example: <%= link_to "Home", root_path %>
# Result: http://example.com/?locale=en
#
@0x7466
0x7466 / le-cert.rb
Last active July 14, 2017 12:26
Easy to use Ruby script to register and authorize new domains on Let's Encrypt and getting certificates for them. Call 'ruby le-new.rb' and follow the instructions. Install OpenSSL and the ACMEClient gem before!
#!/usr/bin/env ruby
begin
require 'acme-client'
rescue LoadError
abort 'MISSING GEM! You haven\'t installed the ACME client. Install the gem with the command \'gem install acme-client\'.'
end
require 'openssl'
require 'resolv'
@0x7466
0x7466 / .railsrc
Last active August 21, 2019 14:34
Rails template
--database=postgresql
--template=https://gist.githubusercontent.com/tobiasfeistmantl/a7893cc591b065772ec4bb216718f5b6/raw/5653f31fbcc960f711349632b98f7d0ebbecc090/rails_template.rb
--skip-coffee